kProxyObjectManagerIID,
NS_GET_IID(nsIProxyObjectManager),
static void PR_CALLBACK EventLoop( void *arg ){    nsresult rv;    printf("Creating EventQueue...\n");    nsIEventQueue* eventQ;    NS_WITH_SERVICE(nsIEventQueueService, eventQService, kEventQueueServiceCID, &rv);    if (NS_SUCCEEDED(rv)) {      rv = eventQService->GetThreadEventQueue(NS_CURRENT_THREAD, &eventQ);      if (NS_FAILED(rv))          rv = eventQService->CreateThreadEventQueue();      if (NS_FAILED(rv))          return;      else          rv = eventQService->GetThreadEventQueue(NS_CURRENT_THREAD, &eventQ);    }    if (NS_FAILED(rv)) return;    rv = eventQ->QueryInterface(nsIEventQueue::GetIID(), (void**)&gEventQueue);    if (NS_FAILED(rv)) return;         printf("Verifing calling Proxy on eventQ thread.\n");    nsIProxyObjectManager*  manager;        nsServiceManager::GetService( NS_XPCOMPROXY_PROGID,                                   kProxyObjectManagerIID,                                  (nsISupports **)&manager);        PR_ASSERT(manager);    nsITestProxy         *proxyObject;    nsTestXPCFoo*         foo   = new nsTestXPCFoo();        PR_ASSERT(foo);    manager->GetProxyObject(gEventQueue, nsITestProxy::GetIID(), foo, PROXY_SYNC, (void**)&proxyObject);    PRInt32 a;    proxyObject->Test(1, 2, &a);    proxyObject->Test2();        NS_RELEASE(proxyObject);    delete foo;    printf("End of Verification calling Proxy on eventQ thread.\n");    printf("Looping for events.\n");    PLEvent* event = nsnull;        while ( PR_SUCCESS == PR_Sleep( PR_MillisecondsToInterval(1)) )    {        rv = gEventQueue->GetEvent(&event);        if (NS_FAILED(rv))            return;		gEventQueue->HandleEvent(event);    }    gEventQueue->ProcessPendingEvents();     printf("Closing down Event Queue.\n");    delete gEventQueue;    gEventQueue = nsnull;    printf("End looping for events.\n\n");}