+ // No need to store the main loop again
+ if (s_mainRunLoop != NULL)
+ return true;
+
+ // Get the loop for the main thread so our events will actually fire.
+ // The common socket.cpp code will assert if initialize is called from a
+ // secondary thread, otherwise Mac would have the same problems as MSW
+ s_mainRunLoop = CFRunLoopGetCurrent();
+ CFRetain(s_mainRunLoop);
+
+ return true;