DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

thr_suspend(3thread)


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(3thread), _lwp_continue(2), _lwp_suspend(2), thr_continue(3thread), thr_create(3thread)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004