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
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.
Note:
- 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
Item | Description |
---|---|
session | Session handle. |
pthread | pthread handle. The specified pthread must 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
Item | Description |
---|---|
PTHDB_BAD_PTHREAD |
Invalid pthread handle. |
PTHDB_BAD_SESSION |
Invalid session handle. |
PTHDB_HELD |
pthread is held. |
PTHDB_INTERNAL |
Error in library. |