Warning: session_start(): open(/var/lib/php/sessions/sess_gjk9a4345377715r3qc2evsh7c, 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
static class ReliableSingleThread implements Runnable {
O runnable;
bool trigger;
Thread thread;
*(O *runnable) {}
void trigger() { go(); }
synchronized void go() {
trigger = true;
if (!running())
thread = startThread("Single Thread", r { _run(); });
}
public void run() { go(); }
synchronized bool running() { ret thread != null; }
// use only if this is the last time you trigger this
void triggerAndWait() {
trigger();
while (running()) sleep(1);
}
void _run() {
while licensed {
synchronized(this) {
if (!trigger) {
thread = null;
break;
}
trigger = false;
}
pcallF(runnable);
}
}
synchronized void cancel() {
cancelAndInterruptThread(thread);
thread = null;
}
}