+
+// Automatic initialization
+class wxThreadModule : public wxModule {
+ DECLARE_DYNAMIC_CLASS(wxThreadModule)
+public:
+ bool OnInit();
+ void OnExit();
+};
+
+bool wxThreadModule::OnInit() {
+ wxMainMutex = new wxMutex();
+ wxMainMutex->Lock();
+ return TRUE;