dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Improve documentation of $wgShowRollbackEditCount"
[lhc/web/wiklou.git]
/
includes
/
ForkController.php
diff --git
a/includes/ForkController.php
b/includes/ForkController.php
index
2d5aa4b
..
c1765e2
100644
(file)
--- a/
includes/ForkController.php
+++ b/
includes/ForkController.php
@@
-30,7
+30,7
@@
* @ingroup Maintenance
*/
class ForkController {
* @ingroup Maintenance
*/
class ForkController {
- protected $children = array();
+ protected $children = array()
, $childNumber = 0
;
protected $termReceived = false;
protected $flags = 0, $procsToStart = 0;
protected $termReceived = false;
protected $flags = 0, $procsToStart = 0;
@@
-137,6
+137,16
@@
class ForkController {
return 'done';
}
return 'done';
}
+ /**
+ * Get the number of the child currently running. Note, this
+ * is not the pid, but rather which of the total number of children
+ * we are
+ * @return int
+ */
+ public function getChildNumber() {
+ return $this->childNumber;
+ }
+
protected function prepareEnvironment() {
global $wgMemc;
// Don't share DB, storage, or memcached connections
protected function prepareEnvironment() {
global $wgMemc;
// Don't share DB, storage, or memcached connections
@@
-150,6
+160,7
@@
class ForkController {
/**
* Fork a number of worker processes.
*
/**
* Fork a number of worker processes.
*
+ * @param int $numProcs
* @return string
*/
protected function forkWorkers( $numProcs ) {
* @return string
*/
protected function forkWorkers( $numProcs ) {
@@
-166,6
+177,7
@@
class ForkController {
if ( !$pid ) {
$this->initChild();
if ( !$pid ) {
$this->initChild();
+ $this->childNumber = $i;
return 'child';
} else {
// This is the parent process
return 'child';
} else {
// This is the parent process