+ 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
+};
+
+enum wxCondError
+{
+ wxCOND_NO_ERROR = 0,
+ wxCOND_INVALID,
+ wxCOND_TIMEOUT, // WaitTimeout() has timed out
+ wxCOND_MISC_ERROR
+};
+
+enum wxSemaError
+{
+ wxSEMA_NO_ERROR = 0,
+ wxSEMA_INVALID, // semaphore hasn't been initialized successfully
+ wxSEMA_BUSY, // returned by TryWait() if Wait() would block
+ wxSEMA_TIMEOUT, // returned by WaitTimeout()
+ wxSEMA_OVERFLOW, // Post() would increase counter past the max
+ wxSEMA_MISC_ERROR
+};
+
+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
+};
+
+enum wxThreadKind
+{
+ wxTHREAD_DETACHED,
+ wxTHREAD_JOINABLE
+};
+
+enum wxThreadWait
+{
+ wxTHREAD_WAIT_BLOCK,
+ wxTHREAD_WAIT_YIELD, // process events while waiting; MSW only
+
+ // For compatibility reasons we use wxTHREAD_WAIT_YIELD by default as this
+ // was the default behaviour of wxMSW 2.8 but it should be avoided as it's
+ // dangerous and not portable.
+#if WXWIN_COMPATIBILITY_2_8
+ wxTHREAD_WAIT_DEFAULT = wxTHREAD_WAIT_YIELD
+#else
+ wxTHREAD_WAIT_DEFAULT = wxTHREAD_WAIT_BLOCK
+#endif
+};
+
+// Obsolete synonyms for wxPRIORITY_XXX for backwards compatibility-only
+enum
+{
+ WXTHREAD_MIN_PRIORITY = wxPRIORITY_MIN,
+ WXTHREAD_DEFAULT_PRIORITY = wxPRIORITY_DEFAULT,
+ WXTHREAD_MAX_PRIORITY = wxPRIORITY_MAX
+};
+
+// There are 2 types of mutexes: normal mutexes and recursive ones. The attempt
+// to lock a normal mutex by a thread which already owns it results in
+// undefined behaviour (it always works under Windows, it will almost always
+// result in a deadlock under Unix). Locking a recursive mutex in such
+// situation always succeeds and it must be unlocked as many times as it has
+// been locked.
+//
+// However recursive mutexes have several important drawbacks: first, in the
+// POSIX implementation, they're less efficient. Second, and more importantly,
+// they CAN NOT BE USED WITH CONDITION VARIABLES under Unix! Using them with
+// wxCondition will work under Windows and some Unices (notably Linux) but will
+// deadlock under other Unix versions (e.g. Solaris). As it might be difficult
+// to ensure that a recursive mutex is not used with wxCondition, it is a good
+// idea to avoid using recursive mutexes at all. Also, the last problem with
+// them is that some (older) Unix versions don't support this at all -- which
+// results in a configure warning when building and a deadlock when using them.
+enum wxMutexType