logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_LockRWLockForWriting - Lock the read/write lock for _write_ operations.

Availability

       This function is available since SDL 3.2.0.

Description

       This will block until the rwlock is available, which is to say it is not locked for reading or writing by
       any  other  thread.  Only  one thread may hold the lock when it requests write access; all other threads,
       whether they also want to write or only want read-only access, must wait  until  the  writer  thread  has
       released the lock.

       It is illegal for the owning thread to lock an already-locked rwlock for writing (read-only may be locked
       recursively, writing can not). Doing so results in undefined behavior.

       It is illegal to request a write lock from a thread that already holds a read-only lock. Doing so results
       in undefined behavior. Unlock the read-only lock before requesting a write lock.

       This  function does not fail; if rwlock is NULL, it will return immediately having locked nothing. If the
       rwlock is valid, this function will always block until it can lock the mutex, and return with it locked.

Function Parameters

rwlock the read/write lock to lock.

Header File

       Defined in SDL3/SDL_mutex.h

Name

       SDL_LockRWLockForWriting - Lock the read/write lock for _write_ operations.

See Also

(3), SDL_LockRWLockForReading(3), (3), SDL_TryLockRWLockForWriting(3), (3), SDL_UnlockRWLock(3)

Simple Directmedia Layer                           SDL 3.2.10                        SDL_LockRWLockForWriting(3)

Synopsis

#include"SDL3/SDL.h"voidSDL_LockRWLockForWriting(SDL_RWLock*rwlock);

See Also