48.1 Sychronization Flags

This section describes the constants used by the synchronization interfaces:

48.1.1 Mutex Types

The pthread_mutexattr_t structure and the functions which set the mattr_kind field use the following flags to specify the type of mutex.

Flag

Value

Description

PTHREAD_MUTEX_NORMAL

0x0000

Indicates that the mutex does not detect deadlock. A thread attempting to relock this mutex, without first unlocking it, deadlocks.

PTHREAD_MUTEX_RECURSIVE

0x0010

Indicates that the mutex is recursive and accepts multiple locks from the same thread. The mutex requires the same number of unlocks to release the mutex.

PTHREAD_MUTEX_ERRORCHECK

0x0020

Unsupported.

PTHREAD_MUTEX_DEFAULT

0x0040

Unsupported.

48.1.2 Process Shared Flags

The various POSIX synchronization primitives (mutexes, reader-writer locks, and condition variables) use the following flags to indicate whether the primitive is private to a single process or if it can be shared with other processes.

Flag

Value

Description

PTHREAD_PROCESS_PRIVATE

0

Indicates that the mutex is private to the process and cannot be shared with other processes.

PTHREAD_PROCESS_SHARED

1

Indicates that the mutex can be shared with multiple processes. This flag is not supported on NetWare.

48.1.3 Protocol Attribute Flags

POSIX mutex interfaces use the following flags to set and get the value of the protocol attribute.

Flag

Value

Description

PTHREAD_PRIO_NONE

0

When a thread owns a mutex set to this protocol, its priority and scheduling is not affected by its mutex ownership. This is the default NetWare behaviour.

PTHREAD_PRIO_INHERIT

1

When a thread owns a mutex set to this protocol, it executes at the highest priority of either the thread or any thread waiting for the mutex. This protocol is not supported on NetWare.

PTHREAD_PRIO_PROTECT

-1

When a thread owns a mutex set to this protocol, it executes at the highest priority of either the thread or any of the mutexes owned by the thread. This protocol is not supported on NetWare.