X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0dd8898753e4e6970531b74917ee294e98e90dfb..f1d5aa1285e4419a067815974b5bad2a1d76c747:/interface/wx/thread.h?ds=sidebyside diff --git a/interface/wx/thread.h b/interface/wx/thread.h index 4b0ebf0ee0..0e83c26d40 100644 --- a/interface/wx/thread.h +++ b/interface/wx/thread.h @@ -316,8 +316,11 @@ public: */ enum wxThreadKind { - wxTHREAD_DETACHED, /** Detached thread */ - wxTHREAD_JOINABLE /** Joinable thread */ + /** Detached thread */ + wxTHREAD_DETACHED, + + /** Joinable thread */ + wxTHREAD_JOINABLE }; /** @@ -325,12 +328,23 @@ enum wxThreadKind */ enum wxThreadError { - wxTHREAD_NO_ERROR = 0, /** No error */ - wxTHREAD_NO_RESOURCE, /** No resource left to create a new thread */ - wxTHREAD_RUNNING, /** The thread is already running */ - wxTHREAD_NOT_RUNNING, /** The thread isn't running */ - wxTHREAD_KILLED, /** Thread we waited for had to be killed */ - wxTHREAD_MISC_ERROR /** Some other error */ + /** No error */ + wxTHREAD_NO_ERROR = 0, + + /** No resource left to create a new thread. */ + wxTHREAD_NO_RESOURCE, + + /** The thread is already running. */ + wxTHREAD_RUNNING, + + /** The thread isn't running. */ + wxTHREAD_NOT_RUNNING, + + /** Thread we waited for had to be killed. */ + wxTHREAD_KILLED, + + /** Some other error */ + wxTHREAD_MISC_ERROR }; /** @@ -846,9 +860,11 @@ public: */ enum wxMutexType { - wxMUTEX_DEFAULT, /** Normal mutex: try to always use this one. Recursive under Windows. */ + /** Normal non-recursive mutex: try to always use this one. */ + wxMUTEX_DEFAULT, - wxMUTEX_RECURSIVE /** Recursive mutex: don't use these ones with wxCondition. */ + /** Recursive mutex: don't use these ones with wxCondition. */ + wxMUTEX_RECURSIVE }; @@ -857,13 +873,26 @@ enum wxMutexType */ enum wxMutexError { - wxMUTEX_NO_ERROR = 0, /** operation completed successfully */ - wxMUTEX_INVALID, /** mutex hasn't been initialized */ - wxMUTEX_DEAD_LOCK, /** mutex is already locked by the calling thread */ - wxMUTEX_BUSY, /** mutex is already locked by another thread */ - wxMUTEX_UNLOCKED, /** attempt to unlock a mutex which is not locked */ - wxMUTEX_TIMEOUT, /** LockTimeout() has timed out */ - wxMUTEX_MISC_ERROR /** any other error */ + /** The operation completed successfully. */ + wxMUTEX_NO_ERROR = 0, + + /** The mutex hasn't been initialized. */ + wxMUTEX_INVALID, + + /** The mutex is already locked by the calling thread. */ + wxMUTEX_DEAD_LOCK, + + /** The mutex is already locked by another thread. */ + wxMUTEX_BUSY, + + /** An attempt to unlock a mutex which is not locked. */ + wxMUTEX_UNLOCKED, + + /** wxMutex::LockTimeout() has timed out. */ + wxMUTEX_TIMEOUT, + + /** Any other error */ + wxMUTEX_MISC_ERROR }; @@ -880,9 +909,9 @@ enum wxMutexError had already locked before (instead of dead locking the entire process in this situation by starting to wait on a mutex which will never be released while the thread is waiting) but using them is not recommended under Unix and they are - @b not recursive there by default. The reason for this is that recursive + @b not recursive by default. The reason for this is that recursive mutexes are not supported by all Unix flavours and, worse, they cannot be used - with wxCondition. On the other hand, Win32 mutexes are always recursive. + with wxCondition. For example, when several threads use the data stored in the linked list, modifications to the list should only be allowed to one thread at a time