Changeset 155098 in webkit for trunk/Source/JavaScriptCore/jsc.cpp
- Timestamp:
- Sep 4, 2013, 11:34:58 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jsc.cpp
r155090 r155098 519 519 int jscmain(int argc, char** argv); 520 520 521 static double s_desiredTimeout; 522 static double s_timeToWake; 523 524 static NO_RETURN_DUE_TO_CRASH void timeoutThreadMain(void*) 525 { 526 // WTF doesn't provide for a portable sleep(), so we use the ThreadCondition, which 527 // is close enough. 528 Mutex mutex; 529 ThreadCondition condition; 530 mutex.lock(); 531 while (currentTime() < s_timeToWake) 532 condition.timedWait(mutex, s_timeToWake); 533 534 dataLog("Timed out after ", s_desiredTimeout, " seconds!\n"); 535 CRASH(); 536 } 537 521 538 int main(int argc, char** argv) 522 539 { … … 567 584 #endif 568 585 JSC::initializeThreading(); 586 587 if (char* timeoutString = getenv("JSC_timeout")) { 588 if (sscanf(timeoutString, "%lf", &s_desiredTimeout) != 1) { 589 dataLog( 590 "WARNING: timeout string is malformed, got ", timeoutString, 591 " but expected a number. Not using a timeout.\n"); 592 } else { 593 s_timeToWake = currentTime() + s_desiredTimeout; 594 createThread(timeoutThreadMain, 0, "jsc Timeout Thread"); 595 } 596 } 569 597 570 598 // We can't use destructors in the following code because it uses Windows
Note:
See TracChangeset
for help on using the changeset viewer.