Warning: session_start(): open(/var/lib/php/sessions/sess_alvvmkbk672n7bqdnd0kpgthd6, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
persistable sclass BoolVar {
bool a; // you can access this directly if you use one thread
*() {}
*(bool *a) {}
public synchronized void set(bool v default true) {
if (v != a) {
a = v;
notifyAll();
}
}
public synchronized bool get() { ret a; }
//public synchronized bool has() { true; }
public void clear aka unset() { set(false); }
bool waitUntilTrue () { ret waitForValue(true); }
bool waitUntilFalse() { ret waitForValue(false); }
bool waitUntilTrue (double timeoutSeconds) { ret waitForValue(timeoutSeconds, true); }
bool waitUntilFalse(double timeoutSeconds) { ret waitForValue(timeoutSeconds, false); }
synchronized bool waitForValue(bool wantedValue) ctex {
while (a != wantedValue)
wait();
ret a;
}
synchronized bool waitForValue(double timeoutSeconds, bool wantedValue) ctex {
if (timeoutSeconds == infinity())
ret waitForValue(wantedValue);
long destTime = sysNowPlusSeconds_noPing(timeoutSeconds), remainingTime;
while (a != wantedValue
&& (remainingTime = destTime-sysNow_noPing()) > 0)
wait(remainingTime);
ret a;
}
public synchronized bool getAndSet(bool b) {
var value = a;
set(b);
ret value;
}
public synchronized bool waitUntilTrueAndClear() {
if (!waitUntilTrue()) false;
set(false);
true;
}
public synchronized bool waitUntilTrueAndClear(double timeoutSeconds) {
if (!waitUntilTrue(timeoutSeconds)) false;
set(false);
true;
}
O mutex() { this; }
}