libs/ips.php
/**
     * Enters a semaphore
     *
     * @param string $name
     *            ident of semaphore
     * @return boolean true if entered semaphore, false if not
     */
Enters a semaphore
@param string $name
ident of semaphore
@return boolean true if entered semaphore, false if not
Enters a semaphore @param string $name ident of semaphore @return boolean true if entered semaphore false if not
private function SemaphoreEnter($name)
    {
        for ($i = 0; $i < 500; $i++) {
            if (IPS_SemaphoreEnter((string)$name . "_" . (string)$this->InstanceID, 1)) {
                return true;
            } else {
                IPS_Sleep(mt_rand(1, 5));
            }
        }
        return false;
    }
private function SemaphoreEnter ( $ name ) { for ( $ i = 0 ; $ i < 500 ; $ i ++ ) { if ( IPS_SemaphoreEnter ( ( string ) $ name . " _ " . ( string ) $ this -> InstanceID , 1 ) ) { return true ; } else { IPS_Sleep ( mt_rand ( 1 , 5 ) ) ; } } return false ; }
Enters a semaphore
 @param string $name
            ident of semaphore
 @return boolean true if entered semaphore, false if not
Enters a semaphore @param string $name ident of semaphore @return boolean true if entered semaphore false if not