]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/thread.h
avoid infinite recursion for richtooltops, (hopefully) fixes #15070
[wxWidgets.git] / interface / wx / thread.h
index adfe7740916d08bfdfd19436d6e6c5c0ef3d7487..e97b4a024c56e144efbd102d7776584ca7eca467 100644 (file)
@@ -584,6 +584,14 @@ public:
     */
     void Enter();
 
+    /**
+        Try to enter the critical section (same as trying to lock a mutex).
+        If it can't, immediately returns false.
+
+        @since 2.9.3
+    */
+    bool TryEnter();
+
     /**
         Leave the critical section allowing other threads use the global data
         protected by it. There is no error return for this function.
@@ -667,17 +675,6 @@ enum wxThreadError
     wxTHREAD_MISC_ERROR
 };
 
-/**
-   Defines the interval of priority
-*/
-enum
-{
-    WXTHREAD_MIN_PRIORITY      = 0u,
-    WXTHREAD_DEFAULT_PRIORITY  = 50u,
-    WXTHREAD_MAX_PRIORITY      = 100u
-};
-
-
 /**
     @class wxThread
 
@@ -1084,7 +1081,7 @@ public:
     /**
         Gets the thread identifier: this is a platform dependent number that uniquely
         identifies the thread throughout the system during its existence
-        (i.e. the thread identifiers may be reused).
+        (i.e.\ the thread identifiers may be reused).
     */
     wxThreadIdType GetId() const;
 
@@ -1105,17 +1102,14 @@ public:
     static wxThreadIdType GetMainId();
 
     /**
-        Gets the priority of the thread, between zero and 100.
+        Gets the priority of the thread, between 0 (lowest) and 100 (highest).
 
-        The following priorities are defined:
-          - @b WXTHREAD_MIN_PRIORITY: 0
-          - @b WXTHREAD_DEFAULT_PRIORITY: 50
-          - @b WXTHREAD_MAX_PRIORITY: 100
+        @see SetPriority()
     */
     unsigned int GetPriority() const;
 
     /**
-        Returns @true if the thread is alive (i.e. started and not terminating).
+        Returns @true if the thread is alive (i.e.\ started and not terminating).
 
         Note that this function can only safely be used with joinable threads, not
         detached ones as the latter delete themselves and so when the real thread is
@@ -1226,13 +1220,15 @@ public:
     static bool SetConcurrency(size_t level);
 
     /**
-        Sets the priority of the thread, between 0 and 100.
+        Sets the priority of the thread, between 0 (lowest) and 100 (highest).
+
         It can only be set after calling Create() but before calling Run().
 
-        The following priorities are defined:
-          - @b WXTHREAD_MIN_PRIORITY: 0
-          - @b WXTHREAD_DEFAULT_PRIORITY: 50
-          - @b WXTHREAD_MAX_PRIORITY: 100
+        The following symbolic constants can be used in addition to raw
+        values in 0..100 range:
+          - ::wxPRIORITY_MIN: 0
+          - ::wxPRIORITY_DEFAULT: 50
+          - ::wxPRIORITY_MAX: 100
     */
     void SetPriority(unsigned int priority);