PdLockOffscreen()

Lock an offscreen context

Synopsis:

int PdLockOffscreen( PdOffscreenContext_t *osc,
                     PdOSCLockParams_t *params );

Arguments:

osc
A pointer to the PdOffscreenContext_t structure for the offscreen context. You must call PdCreateOffscreenLock() to create an offscreen lock for this context before you call PdLockOffscreen().
params
A pointer to a PdOSCLockParams_t structure (see below) that defines parameters for the lock. You can pass NULL for this argument.

Library:

ph

Description:

This function locks an offscreen context.

The PdOSCLockParams_t structure includes these members:

uint32_t flags
Flags, including:
struct timespec *time_out
The absolute time at which to stop blocking if you've set Pg_OSC_LOCK_TIMED_OUT in the flags member. This behavior is like that of sem_timedwait().

Returns:

EOK
The context was succesfully locked.
Pg_OSC_LOCK_TIMED_OUT
Time out for lock occurred; the context wasn't locked.
Pg_OSC_LOCK_INVALID
The context lock is no longer valid (or never was in the first place i.e. it wasn't created with PdCreateOffscreenLock()).
Pg_OSC_LOCK_DEADLOCK
A deadlock condition was detected.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PdCreateOffscreenLock(), PdDestroyOffscreenLock(), PdGetOffscreenContextPtr(), PdIsOffscreenLocked(), PdUnlockOffscreen()

Offscreen locks in the Raw Drawing and Animation chapter of the Photon Programmer's Guide