mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-14 02:42:40 +01:00
Fix reentrancy guard in setDebugTimeLimit()
Summary: $initialized is never initialized and onDebugTick() may be registered multiple times. Test Plan: None. The function is normally only called once. Reviewers: O1 Blessed Committers, speck Reviewed By: O1 Blessed Committers, speck Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Differential Revision: https://we.phorge.it/D25469
This commit is contained in:
parent
4535e8753c
commit
486fc95b29
1 changed files with 2 additions and 1 deletions
|
@ -261,10 +261,11 @@ final class PhabricatorStartup {
|
||||||
public static function setDebugTimeLimit($limit) {
|
public static function setDebugTimeLimit($limit) {
|
||||||
self::$debugTimeLimit = $limit;
|
self::$debugTimeLimit = $limit;
|
||||||
|
|
||||||
static $initialized;
|
static $initialized = false;
|
||||||
if (!$initialized) {
|
if (!$initialized) {
|
||||||
declare(ticks=1);
|
declare(ticks=1);
|
||||||
register_tick_function(array(__CLASS__, 'onDebugTick'));
|
register_tick_function(array(__CLASS__, 'onDebugTick'));
|
||||||
|
$initialized = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue