pthread_resume_np.3t (2010 09)
p
pthread_resume_np(3T) pthread_resume_np(3T)
(Pthread Library)
NAME
pthread_resume_np(), pthread_continue(), pthread_suspend() - resume execution of a thread, continue
execution of a thread, and suspend execution of a thread
SYNOPSIS
#include <pthread.h>
int pthread_continue(
pthread_t thread
);
int pthread_resume_np(
pthread_t thread,
int flags
);
int pthread_suspend(
pthread_t thread
);
PARAMETERS
thread whose execution is to be suspended or resumed.
flags Flags to be used by
pthread_resume_np()
. The valid values are:
PTHREAD_COUNT_RESUME_NP
The target thread’s suspension count is decremented by one. If the target thread
was suspended and has a suspend count greater than one, the thread will not
resume execution.
PTHREAD_FORCE_RESUME_NP
The target thread’s suspension count is set to zero. The target will resume execution
even if its suspend count was greater than one.
DESCRIPTION
The
pthread_suspend()
function suspends execution of the target thread specified by thread . The
target thread may not be suspended immediately (at that exact instant). On successful return from the
pthread_suspend()
function, thread is no longer executing. Once a thread has been suspended, sub-
sequent calls to the
pthread_suspend()
function increment a per thread suspension count and return
immediately.
Calling
pthread_suspend()
with the calling thread specified in thread is allowed. Note that in this
case the calling thread shall be suspended during execution of the
pthread_suspend()
function call
and shall only return after another thread has called the
pthread_resume_np()
or
pthread_continue()
function for thread .
The
pthread_continue() function resumes the execution of the target thread thread .Ifthread was
suspended by multiple calls to
pthread_suspend(), only one call to pthread_continue()
is
required to resume the execution of thread . Calling
pthread_continue() for a target thread that is
not suspended shall have no effect and return no errors. Calling pthread_continue() is equivalent
to calling
pthread_resume_np() with the flags parameter specified as
PTHREAD_FORCE_RESUME_NP.
The
pthread_resume_np() function resumes the execution of the target thread specified by thread .
If the flags argument is
PTHREAD_COUNT_RESUME_NP, the target thread’s suspension count is decre-
mented by one. If the flags argument is PTHREAD_FORCE_RESUME_NP, the target thread’s suspension
count is set to zero. When the target thread’s suspension count reaches zero, the target thread is allowed
to continue execution. Calling
pthread_resume_np() for a target thread that is not suspended shall
have no effect and return no errors.
WARNING
This warning is applicable if any of the following conditions is true for a threaded application:
a. The PTHREAD_FORCE_SCOPE_SYSTEM or PTHREAD_COMPAT_MODE environment variable is set
to either 1 or on.
b. The application’s binary is brought forward from a HP-UX 11i v1 release.
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1