This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This exitcode means the alarm handler of the parent process killed the child | |
define ('EXITCODE_PARENT_INTERVENED', 0); // MUST be 0 | |
// This exitcode means the child achieved the second lock. That'd be weird. | |
define ('EXITCODE_LOCK_ACHIEVED', 1); | |
// This exitcode means the second lock got interrupted (and returned false). | |
define ('EXITCODE_LOCK_INTERRUPTED', 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ php test.php 1>log | |
New process: 10500 16:44:52 | |
New process: 11000 16:44:55 | |
New process: 11500 10:00:02 | |
New process: 12000 10:00:02 | |
New process: 12500 10:00:02 | |
New process: 13000 16:45:06 | |
New process: 13500 10:00:02 | |
New process: 14000 10:00:02 | |
[... snipped for brevity ...] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shopt -s progcomp | |
_testnames() | |
{ | |
local cur prev opts base | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
opts="--filter" | |
if [[ $cur == -* || $prev == -* ]]; then |