Broadcasts to all waiting threads, waking all of them up. Note that this method
may be called whether the mutex associated with this condition is locked or
not.
-
+
@see Signal()
*/
void Broadcast();
signalled again to wake up any thread which may start waiting on it later.
Note that this method may be called whether the mutex associated with this
condition is locked or not.
-
+
@see Broadcast()
*/
void Signal();
Wait without waking up any thread, the thread would still wait for another one
and so it is important to ensure that the condition will be signalled after
Wait or the thread may sleep forever.
-
+
@returns Returns wxCOND_NO_ERROR on success, another value if an error
occurred.
-
+
@see WaitTimeout()
*/
wxCondError Wait();
This method is identical to Wait() except that it
returns, with the return code of @c wxCOND_TIMEOUT as soon as the given
timeout expires.
-
+
@param milliseconds
Timeout in milliseconds
*/
should call @ref wxThread::run GetThread()-Run to start running
it. You may optionally specify the stack size to be allocated to it (Ignored on
platforms that don't support setting it explicitly, eg. Unix).
-
+
@returns One of:
*/
wxThreadError Create(unsigned int stackSize = 0);
does not create or start execution of the real thread -- for this you should
use the Create() and Run() methods.
The possible values for @a kind parameters are:
-
+
@b wxTHREAD_DETACHED
-
+
Creates a detached thread.
-
+
@b wxTHREAD_JOINABLE
-
+
Creates a joinable thread.
*/
wxThread(wxThreadKind kind = wxTHREAD_DETACHED);
use a lot of threads (say several hundred), virtual adress space can get tight
unless you explicitly specify a smaller amount of thread stack space for each
thread.
-
+
@returns One of:
*/
wxThreadError Create(unsigned int stackSize = 0);
/**
Returns the number of system CPUs or -1 if the value is unknown.
-
+
@see SetConcurrency()
*/
static int GetCPUCount();
/**
Gets the priority of the thread, between zero and 100.
The following priorities are defined:
-
+
@b WXTHREAD_MIN_PRIORITY
-
+
0
-
+
@b WXTHREAD_DEFAULT_PRIORITY
-
+
50
-
+
@b WXTHREAD_MAX_PRIORITY
-
+
100
*/
int GetPriority() const;
after calling Create() but before calling
Run().
The following priorities are already defined:
-
+
@b WXTHREAD_MIN_PRIORITY
-
+
0
-
+
@b WXTHREAD_DEFAULT_PRIORITY
-
+
50
-
+
@b WXTHREAD_MAX_PRIORITY
-
+
100
*/
void SetPriority(int priority);
Increments the semaphore count and signals one of the waiting
threads in an atomic way. Returns wxSEMA_OVERFLOW if the count
would increase the counter past the maximum.
-
+
@returns One of:
*/
wxSemaError Post();
/**
Same as Wait(), but returns immediately.
-
+
@returns One of:
*/
wxSemaError TryWait();
/**
Wait indefinitely until the semaphore count becomes strictly positive
and then decrement it and return.
-
+
@returns One of:
*/
wxSemaError Wait();
/**
Locks the mutex object. This is equivalent to
LockTimeout() with infinite timeout.
-
+
@returns One of:
*/
wxMutexError Lock();
/**
Try to lock the mutex object during the specified time interval.
-
+
@returns One of:
*/
wxMutexError LockTimeout(unsigned long msec);
/**
Tries to lock the mutex object. If it can't, returns immediately with an error.
-
+
@returns One of:
*/
wxMutexError TryLock();
/**
Unlocks the mutex object.
-
+
@returns One of:
*/
wxMutexError Unlock();