+bool wxThreadModule::OnInit()
+{
+ wxMainMutex = new wxMutex();
+ wxThreadGuiInit();
+ p_mainid = (int)getpid();
+ wxMainMutex->Lock();
+ return TRUE;
+}
+
+void wxThreadModule::OnExit()
+{
+ wxMainMutex->Unlock();
+ wxThreadGuiExit();
+ delete wxMainMutex;
+}
+
+