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_RWLock - A mutex that allows read-only threads to run in parallel.

Availability

       This struct is available since SDL 3.2.0.

Simple Directmedia Layer                           SDL 3.2.10                                  SDL_RWLock(3type)

Description

       A  rwlock  is roughly the same concept as SDL_Mutex , but allows threads that request read-only access to
       all hold the lock at the same time. If a thread requests write access, it will block until all  read-only
       threads  have released the lock, and no one else can hold the thread (for reading or writing) at the same
       time as the writing thread.

       This can be more efficient in cases where several threads need to access data frequently, but changes  to
       that data are rare.

       There  are other rules that apply to rwlocks that don't apply to mutexes, about how threads are scheduled
       and when they can be recursively locked.  These are documented in the other rwlock functions.

Header File

       Defined in SDL3/SDL_mutex.h

Name

       SDL_RWLock - A mutex that allows read-only threads to run in parallel.

Synopsis

#include"SDL3/SDL.h"typedefstructSDL_RWLockSDL_RWLock;

See Also