Changeset 14601 for trunk/FACT++
- Timestamp:
- 11/10/12 13:19:58 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/InterpreterV8.cc
r14600 r14601 38 38 // ------------ 39 39 // Each thread running V8 code needs to be signalled individually for 40 // termination. 40 // termination. Therefor a list of V8 thread ids is created. 41 41 // 42 // If temrination has already be signalled, no thread should start running 43 // anymore (thy could, e.g., wait for their locking). So after locking 44 // it has to be checked if the thread was terminated already. Note 45 // that all calls to Terminate() must be locked to ensure that fThreadId 46 // is correct when it is checked. 47 // 48 // Empty handles: 49 // -------------- 50 // If exceution is terminated, V8 calls might return with empty handles, 51 // e.g. Date::New(). Therefore, the returned handles of these calls have to 52 // be checked in all placed to avoid that V8 will core dump. 53 // 42 54 43 55 // ========================================================================== … … 47 59 void InterpreterV8::Terminate() 48 60 { 49 /* 61 if (!Locker::IsLocked()) 62 JsException("***** InterprterV8::Terminate call not locked *****"); 63 50 64 for (auto it=fThreadIds.begin(); it!=fThreadIds.end(); it++) 51 65 V8::TerminateExecution(*it); 52 66 fThreadIds.clear(); 53 */ 54 if (fThreadId <0)55 return;56 57 V8::TerminateExecution(fThreadId);58 fThreadId = -1;67 68 if (fThreadId>=0) 69 { 70 V8::TerminateExecution(fThreadId); 71 fThreadId = -1; 72 } 59 73 } 60 74 … … 118 132 119 133 const Handle<Script> sleep = Script::Compile(String::New(("dim.sleep("+to_string(ms)+");").c_str())); 120 if ( !sleep.IsEmpty() && !sleep->Run().IsEmpty())134 if (ms==0 || (!sleep.IsEmpty() && !sleep->Run().IsEmpty())) 121 135 { 122 136 Handle<Value> args[] = { };
Note:
See TracChangeset
for help on using the changeset viewer.