Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Threads Library Functionsthr_suspend(3THR)


NAME

 thr_suspend, thr_continue - suspend or continue thread execution

SYNOPSIS

 
cc -mt [ flag... ] file...[ library... ]
#include <thread.h> 
int thr_suspend(thread_t target_thread);
 int thr_continue(thread_t target_thread);

DESCRIPTION

 

The thr_suspend() function immediately suspends the execution of the thread specified by target_thread. On successful return from thr_suspend(), the suspended thread is no longer executing. Once a thread is suspended, subsequent calls to thr_suspend() have no effect.

The thr_continue() function resumes the execution of a suspended thread. Once a suspended thread is continued, subsequent calls to thr_continue() have no effect.

A suspended thread will not be awakened by a signal. The signal stays pending until the execution of the thread is resumed by thr_continue().

RETURN VALUES

 

If successful, the thr_suspend() and thr_continue() functions return 0. Otherwise, a non-zero value is returned to indicate the error.

ERRORS

 

The thr_suspend() or thr_continue() functions will fail if:

ESRCH
The target_thread cannot be found in the current process.
ECANCELED
The target_thread was not suspended because a subsequent thr_continue() occurred before the suspend completed.

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelMT-Safe

SEE ALSO

 

thr_create(3THR), thr_join(3THR), attributes(5), standards(5)


SunOS 5.9Go To TopLast Changed 3 Oct 2001

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.