projects
/
brisk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1c69ee7
)
raddoppiata la dimensione della shared mem
author
Matteo Nastasi (mop)
<nastasi@alternativeoutput.it>
Tue, 1 May 2007 14:12:41 +0000
(14:12 +0000)
committer
Matteo Nastasi (mop)
<nastasi@alternativeoutput.it>
Tue, 1 May 2007 14:12:41 +0000
(14:12 +0000)
web/brisk.phh
patch
|
blob
|
history
diff --git
a/web/brisk.phh
b/web/brisk.phh
index
187566d
..
efe0c71
100644
(file)
--- a/
web/brisk.phh
+++ b/
web/brisk.phh
@@
-959,6
+959,16
@@
function log_auth($sess, $log) {
}
}
}
}
+function log_lock($sess, $log) {
+ if (BRISK_DEBUG != TRUE)
+ return;
+
+ if (($fp = @fopen("/tmp/brisk_lock.log", 'a')) != FALSE) {
+ fwrite($fp, sprintf("SESS: [%d] [%s] [%s]\n", time(), $sess, $log));
+ fclose($fp);
+ }
+}
+
function log_wr($sess, $log) {
if (BRISK_DEBUG != TRUE)
return;
function log_wr($sess, $log) {
if (BRISK_DEBUG != TRUE)
return;
@@
-1012,14
+1022,17
@@
function lock_data()
echo "SEM_GET FAILED";
exit;
}
echo "SEM_GET FAILED";
exit;
}
- if (sem_acquire($res))
+ if (sem_acquire($res)) {
+ log_lock($sess, "LOCK");
return ($res);
return ($res);
+ }
else
return (false);
}
function unlock_data($res)
{
else
return (false);
}
function unlock_data($res)
{
+ log_lock($sess, "UNLOCK");
return (sem_release($res));
}
return (sem_release($res));
}
@@
-1053,7
+1066,7
@@
function &load_data()
exit;
}
exit;
}
- if ($shm = shm_attach($tok,
1
00000 * TABLES_N)) {
+ if ($shm = shm_attach($tok,
2
00000 * TABLES_N)) {
if(($bri = @shm_get_var($shm, $tok)) == false) {
log_main("XXX", "INIT MAIN DATA");
if(($bri = @shm_get_var($shm, $tok)) == false) {
log_main("XXX", "INIT MAIN DATA");
@@
-1085,11
+1098,13
@@
function save_data(&$bri)
do {
$isacq = TRUE;
do {
$isacq = TRUE;
- if (($shm = shm_attach($tok,
1
00000 * TABLES_N)) == FALSE)
+ if (($shm = shm_attach($tok,
2
00000 * TABLES_N)) == FALSE)
break;
break;
- if (shm_put_var($shm, $tok, $bri) == FALSE)
+ if (shm_put_var($shm, $tok, $bri) == FALSE) {
+ echo "DANNO: ".strlen(serialize($bri));
break;
break;
+ }
// log_main("XXX", "QUI CI ARRIVA [".$bri->user[0]->name."]");
$ret = TRUE;
} while (0);
// log_main("XXX", "QUI CI ARRIVA [".$bri->user[0]->name."]");
$ret = TRUE;
} while (0);