rv = proxyObject->Test((PRInt32)eventQ, 0, &retval);
rv = proxyObject->Test(NS_PTR_TO_INT32(eventQ), 0, &retval);
void TestCase_NestedLoop(void *arg){    ArgsStruct *argsStruct = (ArgsStruct*) arg;    nsIProxyObjectManager*  manager;        nsServiceManager::GetService( NS_XPCOMPROXY_CONTRACTID,                                   NS_GET_IID(nsIProxyObjectManager),                                  (nsISupports **)&manager);    printf("ProxyObjectManager: %p \n", manager);        PR_ASSERT(manager);    nsITestProxy         *proxyObject;    nsTestXPCFoo2*        foo   = new nsTestXPCFoo2();        PR_ASSERT(foo);            manager->GetProxyForObject(argsStruct->queue, NS_GET_IID(nsITestProxy), foo, PROXY_SYNC, (void**)&proxyObject);        if (proxyObject)    {        // release ownership of the real object.                 nsresult rv;        PRInt32 threadNumber = argsStruct->threadNumber;                printf("Deleting real Object (%d)\n", threadNumber);        NS_RELEASE(foo);           PRInt32 retval;                printf("Getting EventQueue...\n");        nsIEventQueue* eventQ;        nsCOMPtr<nsIEventQueueService> eventQService =                  do_GetService(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);                    printf("Thread (%d) Prior to calling proxyObject->Test.\n", threadNumber);            rv = proxyObject->Test((PRInt32)eventQ, 0, &retval);               printf("Thread (%d) proxyObject error: %d.\n", threadNumber, rv);            printf("Deleting Proxy Object (%d)\n", threadNumber );            NS_RELEASE(proxyObject);        }            PR_Sleep( PR_MillisecondsToInterval(1000) );  // If your thread goes away, your stack goes away.  Only use ASYNC on calls that do not have out parameters    }}