]> git.saurik.com Git - wxWidgets.git/commitdiff
document that locking a wxMutex or a wxCriticalSection twice from the same thread...
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sun, 8 Mar 2009 12:56:48 +0000 (12:56 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sun, 8 Mar 2009 12:56:48 +0000 (12:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

interface/wx/thread.h

index 0d27327b2549fc4f0311c704cca257fa01e49fb0..3dcb9f3f2aaa08973152e741d858f94b5425b396 100644 (file)
@@ -535,11 +535,17 @@ public:
     ~wxCriticalSection();
 
     /**
-        Enter the critical section (same as locking a mutex).
-
+        Enter the critical section (same as locking a mutex): if another thread
+        has already entered it, this call will block until the other thread
+        calls Leave().
         There is no error return for this function.
-        After entering the critical section protecting some global
-        data the thread running in critical section may safely use/modify it.
+
+        After entering the critical section protecting a data variable,
+        the thread running inside the critical section may safely use/modify it.
+
+        Note that entering the same critical section twice or more from the same
+        thread doesn't result in a deadlock; in this case in fact this function will
+        immediately return.
     */
     void Enter();
 
@@ -1506,6 +1512,9 @@ public:
         Locks the mutex object.
         This is equivalent to LockTimeout() with infinite timeout.
 
+        Note that if this mutex is already locked by the caller thread,
+        this function doesn't block but rather immediately returns.
+
         @return One of: @c wxMUTEX_NO_ERROR, @c wxMUTEX_DEAD_LOCK.
     */
     wxMutexError Lock();