process: add hang method

This commit is contained in:
deepak1556 2015-06-17 20:13:43 +05:30
parent ad59393641
commit 8e05fe3350
2 changed files with 10 additions and 0 deletions

View file

@ -26,6 +26,11 @@ void Crash() {
static_cast<DummyClass*>(NULL)->crash = true;
}
void Hang() {
for (;;)
base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1));
}
// Called when there is a fatal error in V8, we just crash the process here so
// we can get the stack trace.
void FatalErrorCallback(const char* location, const char* message) {
@ -54,6 +59,7 @@ void AtomBindings::BindTo(v8::Isolate* isolate,
mate::Dictionary dict(isolate, process);
dict.SetMethod("crash", &Crash);
dict.SetMethod("hang", &Hang);
dict.SetMethod("log", &Log);
dict.SetMethod("activateUvLoop",
base::Bind(&AtomBindings::ActivateUVLoop, base::Unretained(this)));