Changeset 22689 in vbox
- Timestamp:
- Sep 2, 2009 1:45:51 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 51802
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/python/src/module/_xpcom.cpp
r22687 r22689 500 500 # include <iprt/thread.h> 501 501 # include <iprt/err.h> 502 # include <CarbonEvents.h> 502 # include <CoreFoundation/CFRunLoop.h> 503 # if MAC_OS_X_VERSION_MAX_ALLOWED == 1040 /* ASSUMES this means we're using the 10.4 SDK. */ 504 # include <CarbonEvents.h> 505 # endif 503 506 504 507 // Wrapper that checks if the queue has pending events. … … 549 552 // Work any native per-thread event loops for good measure. 550 553 # ifdef RT_OS_DARWIN 551 RunCurrentEventLoop(0.0005 /*sec*/);554 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.0, false /*returnAfterSourceHandled*/); 552 555 # endif 553 556 … … 580 583 // This deals with the common case where the caller is the main 581 584 // application thread and the queue is a native one. 582 if ( isEventQueueNative(pQueue) 583 && GetCurrentEventLoop() == GetMainEventLoop() 585 if ( isEventQueueNative(pQueue) 586 # if MAC_OS_X_VERSION_MAX_ALLOWED == 1040 /* ASSUMES this means we're using the 10.4 SDK. */ 587 && GetCurrentEventLoop() == GetMainEventLoop() 588 # else 589 && CFRunLoopGetMain() == CFRunLoopGetCurrent() 590 # endif 584 591 ) { 585 OSStatus orc = -1;586 EventTimeoutrdTimeout = cMsTimeout < 0587 ? kEventDurationForever588 : (double)cMsTimeout / 1000;592 OSStatus orc = -1; 593 CFTimeInterval rdTimeout = cMsTimeout < 0 594 ? 1.0e10 595 : (double)cMsTimeout / 1000; 589 596 Py_BEGIN_ALLOW_THREADS; 590 orc = RunCurrentEventLoop(rdTimeout); 597 orc = CFRunLoopRunInMode(kCFRunLoopDefaultMode, rdTimeout, true /*returnAfterSourceHandled*/); 598 if (orc == kCFRunLoopRunHandledSource) 599 orc = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.0, false /*returnAfterSourceHandled*/); 591 600 Py_END_ALLOW_THREADS; 592 if (!orc || orc == eventLoopQuitErr)601 if (!orc || orc == kCFRunLoopRunHandledSource) 593 602 return 0; 594 603 595 if (orc != eventLoopTimedOutErr) {596 NS_WARNING("Unexpected status code from RunCurrentEventLoop");604 if (orc != kCFRunLoopRunTimedOut) { 605 NS_WARNING("Unexpected status code from CFRunLoopRunInMode"); 597 606 RTThreadSleep(1); // throttle 598 607 }
Note:
See TracChangeset
for help on using the changeset viewer.