]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/threadpsx.cpp
Cured some bugs/typos/spacing in docs
[wxWidgets.git] / src / unix / threadpsx.cpp
index a6f79d8db1ca920b157e2feb86a430ac7bf6e685..eee36b4d3a2394b2771f42cda61564171567ae8c 100644 (file)
@@ -101,7 +101,17 @@ public:
 wxMutex::wxMutex()
 {
     p_internal = new wxMutexInternal;
+    
+#if 0
+    /* I don't know where this function is supposed to exist,
+       and NP actually means non-portable, RR. */
+    pthread_mutexattr_t attr_type;
+    pthread_mutexattr_settype( &attr_type, PTHREAD_MUTEX_FAST_NP );
+
+    pthread_mutex_init( &(p_internal->p_mutex), (const pthread_mutexattr_t*) &attr_type );
+#else
     pthread_mutex_init( &(p_internal->p_mutex), (const pthread_mutexattr_t*) NULL );
+#endif
     m_locked = 0;
 }
 
@@ -696,6 +706,8 @@ wxThread::ExitCode wxThread::Delete()
             // wait until the thread stops
             p_internal->Wait();
     }
+    //GL: As we must auto-destroy, the destruction must happen here.
+    delete this;
 
     return NULL;
 }
@@ -717,6 +729,8 @@ wxThreadError wxThread::Kill()
 
                 return wxTHREAD_MISC_ERROR;
             }
+           //GL: As we must auto-destroy, the destruction must happen here (2).
+           delete this;
 
             return wxTHREAD_NO_ERROR;
     }