X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fauth.phh;h=36b75cab1f1f5343ed9b3b5b20978787a62a7d89;hb=d9d7c36af2f5ec4c0688e77e58d3d0b930cd2658;hp=061538872eb99844d92ca2977800eb5d57768952;hpb=aff81ded58cbc8ce9678a56b634448b35e2ea804;p=brisk.git diff --git a/web/Obj/auth.phh b/web/Obj/auth.phh index 0615388..36b75ca 100644 --- a/web/Obj/auth.phh +++ b/web/Obj/auth.phh @@ -244,13 +244,13 @@ class Challenges { return (FALSE); } - function lock_data() + static function lock_data($is_exclusive) { if (($tok = @ftok(FTOK_PATH."/challenges", "B")) == -1) { return (FALSE); } // echo "FTOK ".$tok."
"; - if (($res = sem_get($tok)) == FALSE) { + if (($res = sem_get($tok, ($is_exclusive ? 1 : LOCK_SHARE_MAX) )) == FALSE) { return (FALSE); } if (sem_acquire($res)) { @@ -262,7 +262,7 @@ class Challenges { return (FALSE); } - function unlock_data($res) + static function unlock_data($res) { GLOBAL $sess;