SyncTypeCreate(), SyncTypeCreate_r()

QNX SDP8.0C Library ReferenceAPIDeveloper

Create a synchronization object

Note:
Don't use the SyncTypeCreate() or SyncTypeCreate_r() kernel call directly; instead, use the POSIX functions for synchronization objects (see pthread_mutex_init() for mutexes, sem_init() for semaphores, pthread_cond_init() for condition variables, pthread_barrier_init() for barriers, and pthread_rwlock_init() for read-write locks).

Synopsis:

#include <sys/neutrino.h>

int SyncTypeCreate(
        unsigned type,
        sync_t * sync,
        const struct _sync_attr * attr );

int SyncTypeCreate_r(
        unsigned type,
        sync_t * sync,
        const struct _sync_attr * attr );

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

SyncTypeCreate() and SyncTypeCreate_r() are internal kernel calls that create a synchronization object in the kernel and initializes sync for use in other synchronization kernel calls. These functions are similar, except for the way they indicate errors.

CAUTION:
You should allocate synchronization objects only in normal memory mappings. On certain processors, atomic operations such as calls to pthread_mutex_lock() will cause a fault if the control structure is allocated in uncached memory.

Synchronization objects can be used for mutexes, semaphores, condition variables, barriers, and read-write locks.

You can destroy the synchronization object by calling SyncTypeDestroy().

Blocking states

These calls don't block.

Classification:

QNX OS

Safety:
Cancellation pointNo
Signal handlerYes
ThreadYes
Page updated: