From: Matteo Nastasi (mop) Date: Sun, 20 Mar 2011 17:53:02 +0000 (+0100) Subject: add static prefix for lock and unlock _data methods in class room X-Git-Tag: 3.4.4~5 X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=dc12b4411ae8a71079e455ae017d84b044ff486a;p=brisk.git add static prefix for lock and unlock _data methods in class room --- diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index aab98f4..1893940 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -2381,32 +2381,33 @@ class Room { User::save_data($user_park[$i], $i); $room->user[$i] = $user_park[$i]; } + log_load("FINISH: ".($ret == TRUE ? "TRUE" : "FALSE")); return ($ret); } - function lock_data() + static function lock_data() { - GLOBAL $sess; - - // echo "LOCK: ".FTOK_PATH."/main"; - // exit; - if (($tok = @ftok(FTOK_PATH."/main", "B")) == -1) { - return (FALSE); - } - // echo "FTOK ".$tok."
"; - if (($res = sem_get($tok)) == FALSE) { - return (FALSE); - } - if (sem_acquire($res)) { - log_lock("LOCK room"); - return ($res); - } - else - return (FALSE); + GLOBAL $sess; + + // echo "LOCK: ".FTOK_PATH."/main"; + // exit; + if (($tok = @ftok(FTOK_PATH."/main", "B")) == -1) { + return (FALSE); + } + // echo "FTOK ".$tok."
"; + if (($res = sem_get($tok)) == FALSE) { + return (FALSE); + } + if (sem_acquire($res)) { + log_lock("LOCK room"); + return ($res); + } + else + return (FALSE); } - function unlock_data($res) + static function unlock_data($res) { GLOBAL $sess;