Changeset 23092 in vbox for trunk/include/VBox
- Timestamp:
- Sep 17, 2009 1:20:18 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/EventQueue.h
r22911 r23092 33 33 34 34 #if !defined (VBOX_WITH_XPCOM) 35 # include <windows.h>35 # include <Windows.h> 36 36 #else 37 # include <nsEventQueueUtils.h>37 # include <nsEventQueueUtils.h> 38 38 #endif 39 39 … … 77 77 * Simple event queue. 78 78 * 79 * On Linux, if this queue is created on the main thread, it automatically 80 * processes XPCOM/IPC events while waiting for its own (Event) events. 79 * When using XPCOM, this will map onto the default XPCOM queue for the thread. 80 * So, if a queue is created on the main thread, it automatically processes 81 * XPCOM/IPC events while waiting for its own (Event) events. 82 * 83 * When using Windows, Darwin and OS/2, this will map onto the native thread 84 * queue/runloop. So, windows messages and want not will be processed while 85 * waiting for events. 81 86 */ 82 87 class EventQueue … … 90 95 BOOL waitForEvent (Event **event); 91 96 BOOL handleEvent (Event *event); 92 /**93 * Process events pending on this event queue, and wait94 * up to given timeout, if nothing is available.95 * Must be called on same thread this event queue was created on.96 */97 97 int processEventQueue(uint32_t cMsTimeout); 98 /**99 * Interrupt thread waiting on event queue processing.100 * Can be called on any thread.101 */102 98 int interruptEventQueueProcessing(); 103 /**104 * Get select()'able selector for this event queue, can be -1105 * on platforms not supporting such functionality.106 */107 99 int getSelectFD(); 108 /**109 * Initialize/deinitialize event queues.110 */111 100 static int init(); 112 static int deinit(); 113 /** 114 * Get main event queue instance. 115 */ 116 static EventQueue* getMainEventQueue(); 101 static int uninit(); 102 static EventQueue *getMainEventQueue(); 117 103 118 104 private: 119 static EventQueue *mMainQueue;105 static EventQueue *mMainQueue; 120 106 121 107 #if !defined (VBOX_WITH_XPCOM) 122 108 109 /** The thread which the queue belongs to. */ 123 110 DWORD mThreadId; 111 /** Duplicated thread handle for MsgWaitForMultipleObjects. */ 112 HANDLE mhThread; 124 113 125 114 #else 126 115 116 /** Whether it was created (and thus needs destroying) or if a queue already 117 * associated with the thread was used. */ 127 118 BOOL mEQCreated; 128 119
Note:
See TracChangeset
for help on using the changeset viewer.