Permalink
Browse files

process, feat: interrupt isolate in async mode.

  • Loading branch information...
xicilion committed Oct 17, 2017
1 parent 4520bb3 commit 880f894dc9230b1f2b590251f1bf88ac087c2475
Showing with 9 additions and 4 deletions.
  1. +9 −4 fibjs/src/process/process_signal.cpp
@@ -35,11 +35,14 @@ static void _InterruptCallback(v8::Isolate* v8_isolate, void* data)
_exit(1);
}
void on_signal(int32_t s)
result_t async_signal(const char* name)
{
if (s_check_callback.CompareAndSwap(0, 1) != 0)
_exit(1);
s_isolates.head()->RequestInterrupt(_InterruptCallback, (void*)name);
return 0;
}
void on_signal(int32_t s)
{
const char* name = NULL;
switch (s) {
@@ -58,7 +61,9 @@ void on_signal(int32_t s)
_exit(1);
}
s_isolates.head()->RequestInterrupt(_InterruptCallback, (void*)name);
if (s_check_callback.CompareAndSwap(0, 1) != 0)
_exit(1);
asyncCall(async_signal, name);
}
#ifdef _WIN32

0 comments on commit 880f894

Please sign in to comment.