X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9fc3ad34c5326856aeebf02335244ae315cef688..3b415ba4cdee694574d7235ff0b8341f105cddfe:/docs/latex/wx/thread.tex diff --git a/docs/latex/wx/thread.tex b/docs/latex/wx/thread.tex index 77c2814a59..ad520dc2c5 100644 --- a/docs/latex/wx/thread.tex +++ b/docs/latex/wx/thread.tex @@ -98,14 +98,16 @@ is not stopped during this function execution, so the message handlers may be called from inside it! Delete() may be called for thread in any state: running, paused or even not yet -created. Moreover, it must be called if \helpref{Create}{wxthreadcreate} or +created. Moreover, it must be called if \helpref{Create}{wxthreadcreate} or \helpref{Run}{wxthreadrun} failed for a detached thread to free the memory occupied by the thread object (it will be done in the destructor for joinable threads). Delete() may be called for thread in any state: running, paused or even not yet created. Moreover, it must be called if \helpref{Create}{wxthreadcreate} or \helpref{Run}{wxthreadrun} fail to free -the memory occupied by the thread object. +the memory occupied by the thread object. However, you should not call Delete() +on a detached thread which already terminated - doing so will probably result +in a crash because the thread object doesn't exist any more. For detached threads Delete() will also delete the C++ thread object, but it will not do this for joinable ones. @@ -125,6 +127,16 @@ joinable threads and is the value returned by \helpref{Wait}{wxthreadwait}. This function is called by wxWindows itself and should never be called directly. +\membersection{wxThread::GetCPUCount}\label{wxthreadgetcpucount} + +\func{static int}{GetCPUCount}{\void} + +Returns the number of system CPUs or -1 if the value is unknown. + +\wxheading{See also} + +\helpref{SetConcurrency}{wxthreadsetconcurrency} + \membersection{wxThread::GetId}\label{wxthreadgetid} \constfunc{unsigned long}{GetId}{\void} @@ -251,6 +263,17 @@ Resumes a thread suspended by the call to \helpref{Pause}{wxthreadpause}. This function can only be called from another thread context. +\membersection{wxThread::SetConcurrency}\label{wxthreadsetconcurrency} + +\func{static bool}{SetConcurrency}{\param{size\_t }{level}} + +Sets the thread concurrency level for this process. This is, roughly, the +number of threads that the system tries to schedule to run in parallel. +The value of $0$ for {\it level} may be used to set the default one. + +Returns TRUE on success or FALSE otherwise (for example, if this function is +not implemented for this platform (currently everything except Solaris)). + \membersection{wxThread::TestDestroy}\label{wxthreadtestdestroy} \func{bool}{TestDestroy}{\void} @@ -286,3 +309,4 @@ Waits until the thread terminates and returns its exit code or {\tt You can only Wait() for joinable (not detached) threads. This function can only be called from another thread context. +