MainLogger: fixed UB in writeLogStream()

notify() has to be used inside a synchronized block.
This commit is contained in:
Dylan K. Taylor 2021-02-04 15:03:14 +00:00
parent 317a48d9b0
commit eaf3a86981
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -347,10 +347,12 @@ class MainLogger extends \AttachableThreadedLogger{
fwrite($logResource, $chunk);
}
if($this->syncFlush){
$this->syncFlush = false;
$this->notify(); //if this was due to a sync flush, tell the caller to stop waiting
}
$this->synchronized(function() : void{
if($this->syncFlush){
$this->syncFlush = false;
$this->notify(); //if this was due to a sync flush, tell the caller to stop waiting
}
});
}
/**