Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

int com::EventQueue::init (  )  [static]

Initializes the main event queue instance.

VBox status code.
If you're using the rest of the COM/XPCOM glue library, com::Initialize() will take care of initializing and uninitializing the EventQueue class. If you don't call com::Initialize, you must make sure to call this method on the same thread that did the XPCOM initialization or we'll end up using the wrong main queue.

Definition at line 171 of file EventQueue.cpp.

References Assert, EventQueue(), NULL, and VINF_SUCCESS.

Referenced by com::Initialize().

    Assert(mMainQueue == NULL);
    mMainQueue = new EventQueue();

#if defined (VBOX_WITH_XPCOM)
    /* Check that it actually is the main event queue, i.e. that
       we're called on the right thread. */
    nsCOMPtr<nsIEventQueue> q;
    nsresult rv = NS_GetMainEventQ(getter_AddRefs(q));
    Assert(q == mMainQueue->mEventQ);

    /* Check that it's a native queue. */
    PRBool fIsNative = PR_FALSE;
    rv = mMainQueue->mEventQ->IsQueueNative(&fIsNative);
    Assert(NS_SUCCEEDED(rv) && fIsNative);

    return VINF_SUCCESS;

Generated by  Doxygen 1.6.0   Back to index