Lock an offscreen context
int PdLockOffscreen( PdOffscreenContext_t *osc, PdOSCLockParams_t *params );
- 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().
- A pointer to a PdOSCLockParams_t structure (see below) that defines parameters for the lock. You can pass NULL for this argument.
This function locks an offscreen context.
The PdOSCLockParams_t structure includes these members:
- uint32_t flags
- Flags, including:
- Pg_OSC_LOCK_TIMED_OUT — blocking occurs only until the clock has gone past the value of the time_out member.
- 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().
- The context was succesfully locked.
- Time out for lock occurred; the context wasn't locked.
- The context lock is no longer valid (or never was in the first place i.e. it wasn't created with PdCreateOffscreenLock()).
- A deadlock condition was detected.
“Offscreen locks” in the Raw Drawing and Animation chapter of the Photon Programmer's Guide