]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/thread.tex
Various documentation changes, makefile fixes
[wxWidgets.git] / docs / latex / wx / thread.tex
1 \section{\class{wxThread}}\label{wxthread}
2
3 A wxThread manages a system thread, code which executes as a mini-process within the application.
4
5 \wxheading{Derived from}
6
7 None.
8
9 \wxheading{See also}
10
11 \helpref{wxMutex}{wxmutex}, \helpref{wxCondition}{wxcondition}
12
13 \latexignore{\rtfignore{\wxheading{Members}}}
14
15 \membersection{wxThread::wxThread}\label{wxthreadconstr}
16
17 \func{}{wxThread}{\void}
18
19 Default constructor.
20
21 \membersection{wxThread::\destruct{wxThread}}
22
23 \func{}{\destruct{wxThread}}{\void}
24
25 Destroys the wxThread object.
26
27 \membersection{wxThread::Create}\label{wxthreadcreate}
28
29 \func{wxThreadError}{Create}{\void}
30
31 Creates a thread control.
32
33 \wxheading{Return value}
34
35 One of:
36
37 \twocolwidtha{7cm}
38 \begin{twocollist}\itemsep=0pt
39 \twocolitem{{\bf THREAD\_NO\_ERROR}}{There was no error.}
40 \twocolitem{{\bf THREAD\_NO\_RESOURCE}}{There were insufficient resources to create a new thread.}
41 \twocolitem{{\bf THREAD\_RUNNING}}{The thread is already running.}
42 \end{twocollist}
43
44 \membersection{wxThread::DeferDestroy}\label{wxthreaddeferdestroy}
45
46 \func{void}{DeferDestroy}{\param{bool}{ defer}}
47
48 If {\it defer} is TRUE, defers thread destruction.
49
50 \membersection{wxThread::Destroy}\label{wxthreaddestroy}
51
52 \func{wxThreadError}{Destroy}{\void}
53
54 Destroys the thread immediately unless the application has specified deferral via \helpref{wxThread::DeferDestroy}{deferdestroy}.
55
56 \wxheading{Return value}
57
58 One of:
59
60 \twocolwidtha{7cm}
61 \begin{twocollist}\itemsep=0pt
62 \twocolitem{{\bf THREAD\_NO\_ERROR}}{There was no error.}
63 \twocolitem{{\bf THREAD\_NOT\_RUNNING}}{The thread is not running.}
64 \end{twocollist}
65
66 \membersection{wxThread::GetID}\label{wxthreadgetid}
67
68 \constfunc{unsigned long}{GetID}{\void}
69
70 Gets the thread identifier.
71
72 \membersection{wxThread::GetPriority}\label{wxthreadgetpriority}
73
74 \constfunc{int}{GetPriority}{\void}
75
76 Gets the priority of the thread, between zero and 100.
77
78 The following priorities are already defined:
79
80 \twocolwidtha{7cm}
81 \begin{twocollist}\itemsep=0pt
82 \twocolitem{{\bf WXTHREAD_MIN_PRIORITY}}{0}
83 \twocolitem{{\bf WXTHREAD_DEFAULT_PRIORITY}}{50}
84 \twocolitem{{\bf WXTHREAD_MAX_PRIORITY}}{100}
85 \end{twocollist}
86
87 \membersection{wxThread::IsAlive}\label{wxthreadisalive}
88
89 \constfunc{bool}{IsAlive}{\void}
90
91 Returns TRUE if the thread is alive.
92
93 \membersection{wxThread::IsMain}\label{wxthreadismain}
94
95 \constfunc{bool}{IsMain}{\void}
96
97 Returns TRUE if the thread is the main application thread.
98
99 \membersection{wxThread::Join}\label{wxthreadjoin}
100
101 \func{void*}{Join}{\void}
102
103 Waits for the termination of the thread. Returns a platform-specific exit code. TODO
104
105 \membersection{wxThread::OnExit}\label{wxthreadonexit}
106
107 \func{void}{OnExit}{\void}
108
109 Called when the thread exits. The default implementation calls \helpref{wxThread::Join}{wxthreadjoin}.
110
111 \membersection{wxThread::SetPriority}\label{wxthreadsetpriority}
112
113 \func{void}{SetPriority}{\param{int}{ priority}}
114
115 Sets the priority of the thread, between zero and 100. This must be set before the thread is created.
116
117 The following priorities are already defined:
118
119 \twocolwidtha{7cm}
120 \begin{twocollist}\itemsep=0pt
121 \twocolitem{{\bf WXTHREAD_MIN_PRIORITY}}{0}
122 \twocolitem{{\bf WXTHREAD_DEFAULT_PRIORITY}}{50}
123 \twocolitem{{\bf WXTHREAD_MAX_PRIORITY}}{100}
124 \end{twocollist}
125