semaphore issue resolved

main
hecht 8 years ago
parent c92d45debd
commit c0b77ca795

@ -44,7 +44,7 @@ function semaphoreUP($resource){
db_query('DELETE FROM semaphore WHERE TIMESTAMPDIFF(MINUTE, zeit, now()) > 5 and ressource = \''.$resource.'\''); db_query('DELETE FROM semaphore WHERE TIMESTAMPDIFF(MINUTE, zeit, now()) > 5 and ressource = \''.$resource.'\'');
$sql = 'INSERT INTO semaphore(ressource) values(\''.$resource.'\')'; $sql = 'INSERT INTO semaphore(ressource) values(\''.$resource.'\')';
db_query($sql); silent_query($sql);
if(db_affected_rows() > 0){ if(db_affected_rows() > 0){
// echo 'DEBUG: Semaphore fuer '.$ressource.' belegt!('.db_affected_rows().')<br>'; // echo 'DEBUG: Semaphore fuer '.$ressource.' belegt!('.db_affected_rows().')<br>';
$GLOBALS['semaphorecount']++; $GLOBALS['semaphorecount']++;
@ -61,7 +61,7 @@ function semaphoreUP($resource){
// @Returns TRUE if ok, FALSE on Semaphore error, NULL on MYQL Error // @Returns TRUE if ok, FALSE on Semaphore error, NULL on MYQL Error
function semaphoreDown($resource){ function semaphoreDown($resource){
$sql = 'DELETE FROM semaphore where ressource = \''.$resource.'\''; $sql = 'DELETE FROM semaphore where ressource = \''.$resource.'\'';
db_query($sql); silent_query($sql);
if(db_affected_rows() == 0){ if(db_affected_rows() == 0){
// echo 'DEBUG: Semaphore '.$ressource.' war schon freigegeben<br>'; // echo 'DEBUG: Semaphore '.$ressource.' war schon freigegeben<br>';
return false; return false;

Loading…
Cancel
Save