Warning: session_start(): open(/var/lib/php/sessions/sess_5kks3s6n7gh0kab22evfpf7rhl, 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
!7
static new Flag taken;
static Android3 android;
static Lock lock = lock();
p {
android = androidAtPrecisePort(preSpunVMPort(), "A pre-spun VM.", mc());
if (android != null)
print("Using primary port!");
else {
print("Using regular port.");
android = makeAndroid3("A pre-spun VM.");
}
hideVM();
taken.waitUntilUp();
}
static S answer(S s, L history) {
lock lock;
new Matches m;
if (match3("please start program *", s, m)) {
final S progID = formatSnippetID(unquote(m.m[0]));
return startIt(progID, "");
}
if (match3("please start program * with arguments *", s, m)) {
final S progID = formatSnippetID(unquote(m.m[0]));
final S args = unquote(m.m[1]);
return startIt(progID, args);
}
if (match3("are you free to start a program?", s))
ret !taken.isUp() ? "Yes." : "No.";
ret null;
}
static S startIt(final S progID, S args) {
lock lock;
if (taken.isUp()) ret "Sorry, not free anymore.";
taken.raise();
// Remove my injection (without cleanup) so program becomes first injection
synchronized(javax()) {
L injections = (L) get(javax(), 'injectable_programsInjected);
injections.remove(0);
}
final S[] splitArgs = toStringArray(codeTokensOnly(javaTok(args))); // yeah this is bad...
thread {
Class c = hotwire(progID);
callMain(c, splitArgs);
}
thread {
setConsoleTitle(snippetTitle(progID));
}
if (android != null) {
android.dispose();
android = null;
}
if (usePreSpunVMs()) startPreSpunVM(); // Start another one
unhideVM();
ret "OK.";
}