Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (18 sloc) 407 Bytes
---
sem: |-
<?php
$SEMKey = "123456" ;
## Get Semaphore id
$seg = sem_get( $SEMKey, 2, 0666, -1) ;
if ( $argv[1]=="remove" ) {
sem_remove($seg);
}
echo "Try to acquire ..."
sem_acquire($seg);
echo "Acquired...\n" ;
echo "Press Any Key to continue...\n";
$fh = fopen("php://stdin", "r");
$a = fgets( $fh);
fclose($fh);
sem_release($seg);
?>