pike.git
/
lib
/
modules
/
Sql.pmod
/
pgsql_util.pmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Sql.pmod/pgsql_util.pmod:158:
}; class conxiin { inherit Stdio.Buffer:i; final Thread.Condition fillread; final Thread.Mutex fillreadmux; final function(:void) gottimeout; final int timeout;
+
private int didreadcb;
protected bool range_error(int howmuch) { #ifdef PG_DEBUG if(howmuch<=0) error("Out of range %d\n",howmuch); #endif if(fillread) { array cid=callout(gottimeout,timeout); Thread.MutexKey lock=fillreadmux->lock();
-
if(
howmuch>sizeof(this
)
)
+
if(
!didreadcb
)
fillread.wait(lock);
-
+
didreadcb=0;
lock=0; local_backend->remove_call_out(cid); } else throw(MAGICTERMINATE); return true; } final int read_cb(mixed id,mixed b) { Thread.MutexKey lock=fillreadmux->lock(); if(fillread)
-
fillread.signal();
+
didreadcb=1,
fillread.signal();
lock=0; return 0; } protected void create() { i::create(); gottimeout=nop; // Preset it with a NOP timeout=128; // Just a reasonable amount fillreadmux=Thread.Mutex(); fillread=Thread.Condition();