[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Base Operating System and Extensions Technical Reference, Volume 1

pthdb_attr_detachstate, pthdb_attr_inheritsched, pthdb_attr_schedparam, pthdb_attr_schedpolicy, pthdb_attr_schedpriority, pthdb_attr_scope or pthdb_attr_suspendstate Subroutine

pthdb_attr_detachstate, pthdb_attr_inheritsched, pthdb_attr_schedparam, pthdb_attr_schedpolicy, pthdb_attr_schedpriority, pthdb_attr_scope or pthdb_attr_suspendstate Subroutine

Purpose

Query the various fields of a pthread attribute and return the results in the specified buffer.

Library

pthread debug library (libpthdebug.a)

Syntax

#include <sys/pthdebug.h>

int pthdb_attr_detachstate (pthdb_session_t     session,
                            pthdb_attr_t        attr,
                            pthdb_detachstate_t *detachstatep);
int pthdb_attr_inheritsched (pthdb_session_t      session,
                             pthdb_attr_t         attr,
                             pthdb_inheritsched_t *inheritschedp);
int pthdb_attr_schedparam (pthdb_session_t    session,
                           pthdb_attr_t       attr,
                           struct sched_param *schedparamp);
int pthdb_attr_schedpolicy (pthdb_session_t session,
                            pthdb_attr_t    attr,
                            pthdb_policy_t  *schedpolicyp)
int pthdb_attr_schedpriority (pthdb_session_t session,
                              pthdb_attr_t    attr,
                              int             *schedpriorityp)
int pthdb_attr_scope (pthdb_session_t session,
                      pthdb_attr_t    attr,
                      pthdb_scope_t   *scopep)
int pthdb_attr_suspendstate (pthdb_session_t      session,
                             pthdb_attr_t         attr,
                             pthdb_suspendstate_t *suspendstatep)

Description

Each pthread is created using either the default pthread attribute or a user-specified pthread attribute. These functions query the various fields of a pthread attribute and, if successful, return the result in the buffer specified. In all cases, the values returned reflect the expected fields of a pthread created with the attribute specified.

pthdb_attr_detachstate reports if the created pthread is detachable (PDS_DETACHED) or joinable (PDS_JOINABLE). PDS_NOTSUP is reserved for unexpected results.

pthdb_attr_inheritsched reports whether the created pthread will run with scheduling policy and scheduling parameters from the created pthread (PIS_INHERIT), or from the attribute (PIS_EXPLICIT). PIS_NOTSUP is reserved for unexpected results.

pthdb_attr_schedparam reports the scheduling parameters associated with the pthread attribute. See pthdb_attr_inheritsched for additional information.

pthdb_attr_schedpolicy reports whether the scheduling policy associated with the pthread attribute is other (SP_OTHER), first in first out (SP_FIFO), or round robin (SP_RR). SP_NOTSUP is reserved for unexpected results.

pthdb_attr_schedpriority reports the scheduling priority associated with the pthread attribute. See pthdb_attr_inheritsched for additional information.

pthdb_attr_scope reports whether the created pthread will have process scope (PS_PROCESS) or system scope (PS_SYSTEM). PS_NOTSUP is reserved for unexpected results.

pthdb_attr_suspendstate reports whether the created pthread will be suspended (PSS_SUSPENDED) or not (PSS_UNSUSPENDED). PSS_NOTSUP is reserved for unexpected results.

Parameters

session Session handle.
attr Attribute handle.
detachstatep Detach state buffer.
inheritschedp Inherit scheduling buffer.
schedparamp Scheduling parameters buffer.
schedpolicyp Scheduling policy buffer.
schedpriorityp Scheduling priority buffer.
scopep Contention scope buffer.
suspendstatep Suspend state buffer.

Return Values

If successful these functions return PTHDB_SUCCESS. Otherwise, and error code is returned.

Error Codes

PTHDB_BAD_SESSION Invalid session handle.
PTHDB_BAD_ATTR Invalid attribute handle.
PTHDB_BAD_POINTER Invalid buffer pointer.
PTHDB_CALLBACK Debugger call back error.
PTHDB_NOTSUP Not supported.
PTHDB_INTERNAL Internal library error.

Implementation Specifics

These subroutines are part of the Base Operating System (BOS) Runtime.

Related Information

The pthdebug.h file.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]