In the main thread (in main() function of the exe file) I use this
loop:
nsCOMPtr<nsIEventQueue> pEventQ = nsnull;
rv = eventQService->GetThreadEventQueue(NS_CURRENT_THREAD,
getter_AddRefs(pEventQ));
NS_ENSURE_SUCCESS(rv, rv);
...
while (!g_bStop) {
PLEvent* event;
rv = pEventQ->WaitForEvent(&event);
if (NS_FAILED(rv)) return rv;
rv = pEventQ->HandleEvent(event);
if (NS_FAILED(rv)) return rv;
}
This approach is taken from tests for necko. g_bStop variable is always
PR_TRUE. It is not set to false in any time.
_______________________________________________
Mozilla-netlib mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-netlib