Permalink
Browse files

core, feat: exit application directly while v8 is not alive.

  • Loading branch information...
xicilion committed Oct 17, 2017
1 parent 4ec77e3 commit 5b2c83f57c4726055ea1641d525d6a98dc09f1d6
Showing with 7 additions and 2 deletions.
  1. +7 −2 fibjs/src/process/process_signal.cpp
@@ -21,9 +21,11 @@
namespace fibjs {
extern exlib::LockedList<Isolate> s_isolates;
exlib::atomic s_check_callback;
static void _InterruptCallback(v8::Isolate* v8_isolate, void* data)
{
s_check_callback = 0;
Isolate* isolate = Isolate::current();
JSTrigger t(isolate->m_isolate, process_base::class_info().getModule(isolate));
bool r = false;
@@ -35,6 +37,9 @@ static void _InterruptCallback(v8::Isolate* v8_isolate, void* data)
void on_signal(int32_t s)
{
if (s_check_callback.CompareAndSwap(0, 1) != 0)
_exit(1);
const char* name = NULL;
switch (s) {
@@ -46,8 +51,8 @@ void on_signal(int32_t s)
break;
#ifdef SIGBREAK
case SIGBREAK:
name = "SIGINT";
break;
name = "SIGINT";
break;
#endif
default:
_exit(1);

0 comments on commit 5b2c83f

Please sign in to comment.