More examples and tweaks
* Signal dispatch() method now uses own pid as default value * SharedData now updates checksum cache on set()
This commit is contained in:
1 parent
86ff40274b
commit
176f9aa5ec
8 files changed
+148
-3
No files matched your search
@@ -113,6 +113,7 @@ class SharedData extends SharedMemory
|
||||
|
||||
// Update the data
|
||||
$this[self::IDX_DATA + $index] = [ md5($value), $value ];
|
||||
$this->checks[$key] = md5($value);
|
||||
$this->unlock();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ class Signal
|
||||
pcntl_signal($this->signo, $handler);
|
||||
}
|
||||
|
||||
public function dispatch($pid):bool
|
||||
public function dispatch($pid=null):bool
|
||||
{
|
||||
return posix_kill($pid, $this->signo);
|
||||
return posix_kill($pid?:posix_getpid(), $this->signo);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user