Changeset 22724 in vbox for trunk/src/libs/xpcom18a4
- Timestamp:
- Sep 2, 2009 3:20:30 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 51850
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/python/src/module/_xpcom.cpp
r22692 r22724 493 493 494 494 #ifdef VBOX 495 # include <iprt/cdefs.h> 495 #define USE_EVENTQUEUE 1 496 497 # ifdef USE_EVENTQUEUE 498 # include <VBox/com/EventQueue.h> 499 # include <iprt/err.h> 500 # else 501 # include <iprt/cdefs.h> 502 # endif 496 503 497 504 static nsIEventQueue* g_mainEventQ = nsnull; 498 505 506 # ifndef USE_EVENTQUEUE /** @todo Make USE_EVENTQUEUE default. */ 499 507 // Wrapper that checks if the queue has pending events. 500 508 DECLINLINE(bool) … … 616 624 617 625 # endif /* RT_OS_DARWIN */ 626 # endif /* !USE_EVENTQUEUE */ 618 627 619 628 static PyObject* … … 623 632 624 633 if (!PyArg_ParseTuple(args, "i", &aTimeout)) 625 return NULL; 634 return NULL; /** @todo throw exception */ 626 635 627 636 nsIEventQueue* q = g_mainEventQ; 628 637 if (q == nsnull) 629 return NULL; 630 638 return NULL; /** @todo throw exception */ 639 640 # ifdef USE_EVENTQUEUE 641 int rc = com::EventQueue::processThreadEventQueue(aTimeout < 0 ? RT_INDEFINITE_WAIT : (uint32_t)aTimeout); 642 if (RT_SUCCESS(rc)) 643 return PyInt_FromLong(0); 644 if ( rc == VERR_TIMEOUT 645 || rc == VERR_INTERRUPTED) 646 return PyInt_FromLong(1); 647 return NULL; /** @todo throw exception */ 648 649 # else /* !USE_EVENTQUEUE */ 631 650 NS_WARN_IF_FALSE(isEventQueueNative(q), "The event queue must be native!"); 632 651 633 652 PRInt32 result = 0; 634 # ifdef RT_OS_DARWIN653 # ifdef RT_OS_DARWIN 635 654 if (aTimeout != 0 && !hasEventQueuePendingEvents(q)) 636 655 result = waitForEventsOnDarwin(q, aTimeout); … … 638 657 q->ProcessPendingEvents(); 639 658 640 # else /* !RT_OS_DARWIN */659 # else /* !RT_OS_DARWIN */ 641 660 642 661 PRBool hasEvents = PR_FALSE; … … 693 712 ok: 694 713 q->ProcessPendingEvents(); 695 # endif /* !RT_OS_DARWIN */ 696 714 # endif /* !RT_OS_DARWIN */ 697 715 return PyInt_FromLong(result); 716 # endif /* !USE_EVENTQUEUE */ 698 717 } 699 718
Note:
See TracChangeset
for help on using the changeset viewer.