DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

thr_suspend(THREAD)


thr_suspend -- suspend the execution of a thread

Synopsis

   cc [options] -Kthread file
   

#include <thread.h>

int thr_suspend(thread_t target_thread);

Description

thr_suspend suspends execution of target_thread. thr_suspend returns when target_thread is suspended. A concurrent thr_continue of the same thread might be lost or might take effect depending on the timing.

If target_thread is already suspended, thr_suspend has no effect.

A thread might suspend itself.

thr_continue will resume the execution of target_thread.

Parameters


target_thread
thread ID of the thread to be suspended

Return values

thr_suspend returns zero for success and an error number for failure.

Errors

If any of the following conditions occurs, thr_suspend returns the corresponding value:

ESRCH
target_thread cannot be found in the current process

Usage

We do not recommend using thr_suspend and thr_continue to synchronize threads. Use synchronization routines instead.

References

Intro(THREAD), _lwp_continue(S), _lwp_suspend(S), thr_continue(THREAD), thr_create(THREAD)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005