osStopThread.3p
1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.TH osStartThread 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
osStopThread \- suspend a thread
.SH SYNOPSIS
.nf
\f3
.Op c
#include <ultra64.h>
.sp .8v
void osStopThread(OSThread \(**t);
.Op
\f1
.fi
.SH DESCRIPTION
The
.I osStopThread
call will suspend the given thread
.IR t ,
preventing it from becoming runnable until a subsequence call to
.I osStartThread
on the same thread.
If
.I t
is NULL,
the running thread is stopped and the dispatcher is invoked to run the new
highest priority runnable thread.
If
.I t
is not the invoking thread,
it should either be on the run queue or on a queue of threads blocked to
send or receive a mesage.
In these cases,
.I osStopThread
simply removes the thread from the queue it is on.
The
.I osStartThread
call will restore the thread to that queue.
.PP
This method of implementation,
though efficient,
has some side effects.
Intuitively,
one would expect the following sequence to have no effect:
.Ex
osStopThread(t);
osStartThread(t);
.Ee
Due to the fact that the thread
.I t
is removed and then reinserted into the queue,
it will be moved after all of the other threads of the same priority,
and cause a change in behavior.
.SH "SEE ALSO"
.IR osCreateThread (3P),
.IR osGetThreadId (3P),
.IR osGetThreadPri (3P),
.IR osStartThread (3P),
.IR osYieldThread (3P)