[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]
Technical Reference: Base Operating System and Extensions, Volume 1
pthdb_pthread_hold, pthdb_pthread_holdstate or pthdb_pthread_unhold
Subroutine
Purpose
Reports and changes the hold state of the specified pthread.
Library
pthread debug library (libpthdebug.a)
Syntax
#include <sys/pthdebug.h>
int pthdb_pthread_holdstate (pthdb_session_t session,
pthdb_pthread_t pthread,
pthdb_holdstate_t * holdstatep)
int pthdb_pthread_hold (pthdb_session_t session,
pthdb_pthread_t pthread)
int pthdb_pthread_unhold (pthdb_session_t session,
pthdb_pthread_t pthread)
Description
pthdb_pthread_holdstate reports if a pthread is held.
The possible hold states are PHS_HELD, PHS_NOTHELD, or PHS_NOTSUP.
pthdb_pthread_hold prevents the specified pthread
from running.
pthdb_pthread_unhold unholds the specified pthread.
The pthread held earlier can be unheld by calling this function.
Notes:
- You must always use the pthdb_pthread_hold and pthdb_pthread_unhold functions, regardless of whether or
not a pthread has a kernel thread.
- These functions are only supposted when the PTHDB_FLAG_HOLD is set.
Parameters
|
session |
Session handle. |
|
pthread |
pthread handle. The specified pthread
should have an attached kernel thread id. |
|
holdstatep |
Pointer to the hold state |
|
Return Values
If successful, pthdb_pthread_hold returns PTHDB_SUCCESS. Otherwise, it returns an error code.
Error Codes
| PTHDB_BAD_PTHREAD |
Invalid pthread handle. |
| PTHDB_BAD_SESSION |
Invalid session handle. |
| PTHDB_HELD |
pthread is held. |
| PTHDB_INTERNAL |
Error in library. |
Related Information
The pthdb_session_setflags
subroutine.
The pthdebug.h file.
The pthread.h file.
[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]