OSSuspendThread

Syntax

#include <cafe/os.h>

s32 OSSuspendThread (OSThread* thread);

Parameters

thread Pointer to thread to suspend.

Return Values

The previous suspend counter of the thread. If failed to suspend, -1 will return.

Description

Increments the suspend count and suspends the thread if the counter is greater than zero.

Suspend takes place when the specified thread reaches specific points in its execution. Until suspend completes, this function will not return. If it ends before the specified thread suspends, -1 will return. The specified thread can be suspended at the following points.

NOTE:
Suspend will not occur as long as the thread is blocking. For example, the thread waits for the mutex and OSSpinLock.

Perform suspend under the following conditions:

The OS keeps track of the number of times OSSuspendThread has been called. Calling OSResumeThread will decrement that counter. While the counter is greater than zero, the thread will not be scheduled to execute. OSContinueThread clears the counter and starts scheduling.

Do Not Call From

None.

See Also

OSResumeThread
OSContinueThread
OSIsThreadSuspended
OSTestThreadCancel
OSSetThreadCancelState

Revision History

2013-05-08 Automated cleanup pass.
2012-08-01 Cleanup pass.
2011-11-25 Modified the spec.
2011-10-14 Initial version.


CONFIDENTIAL