public static string executeSnippet_SeparateThread(string snippet)
{
UserRole.Admin.demand();
var executionResult = "";
var sync = new AutoResetEvent(false);
var thread = O2Thread.mtaThread(
()=>{
executionResult = executeSnippet(snippet);
sync.Set();
});
if (thread.Join(MAX_EXECUTION_TIME).isFalse())
{
"[REPL] Execution timeout reached".error();
return "Error: Snippet execution timed out";
}
return executionResult;
}