X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fhardban.phh;h=7423b6a59e5c39e2932a7c094d20ace44a8de8fc;hb=e47ddcae6cc33ed9d2471a54936db7d8efd5d46a;hp=ffec9c631ee356d085285d3bc8c929333e075e1d;hpb=312a6acc00ec7f331ab461894c319776eec95cae;p=brisk.git diff --git a/web/Obj/hardban.phh b/web/Obj/hardban.phh index ffec9c6..7423b6a 100644 --- a/web/Obj/hardban.phh +++ b/web/Obj/hardban.phh @@ -44,6 +44,8 @@ class Hardban { } class Hardbans { + static $delta_t; + var $item; var $item_n; var $mod; @@ -155,11 +157,10 @@ class Hardbans { function load_data() { GLOBAL $sess; - $doexit = FALSE; + do { if (($tok = @ftok(FTOK_PATH."/hardbans", "B")) == -1) { log_main("ftok failed"); - $doexit = TRUE; break; } @@ -171,7 +172,7 @@ class Hardbans { $shm_sz = HBAN_SHM_DIMS_MIN; if ($shm = shm_attach($tok, $shm_sz)) { - $hban = @shm_get_var($shm, $tok); + $hban = @shm_get_var($shm, $tok); // CHECKED BELOW log_only("hardban == ".($hban == FALSE ? "FALSE" : "TRUE")." hardban === ".($hban === FALSE ? "FALSE" : "TRUE")." hardban isset ".(isset($hban) ? "TRUE" : "FALSE")); @@ -194,9 +195,6 @@ class Hardbans { return ($hban); } while (0); - if ($doexit) - exit(); - return (FALSE); } @@ -247,7 +245,8 @@ class Hardbans { return (FALSE); } if (sem_acquire($res)) { - log_lock("LOCK hardbans"); + self::$delta_t = microtime(TRUE); + log_lock("LOCK hardbans [".self::$delta_t."]"); return ($res); } else @@ -258,7 +257,7 @@ class Hardbans { { GLOBAL $sess; - log_lock("UNLOCK hardbans"); + log_lock("UNLOCK hardbans [".(microtime(TRUE) - (self::$delta_t))."]"); return (sem_release($res)); }