SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::PropertiesLock Class Reference

Lock a group of properties. More...

Public Member Functions

 PropertiesLock (PropertiesRef resource)
 Lock a group of properties. More...
 
 PropertiesLock (const PropertiesLock &other)=delete
 Copy constructor.
 
constexpr PropertiesLock (PropertiesLock &&other) noexcept
 Move constructor.
 
 ~PropertiesLock ()
 Unlock a group of properties. More...
 
PropertiesLockoperator= (const PropertiesLock &other)=delete
 
PropertiesLockoperator= (PropertiesLock &&other) noexcept
 Assignment operator.
 
constexpr operator bool () const
 True if not locked.
 
void reset ()
 Unlock a group of properties. More...
 
PropertiesRef get ()
 Get the reference to locked resource.
 
void release ()
 Releases the lock without unlocking.
 

Detailed Description

Obtain a multi-threaded lock for these properties. Other threads will wait while trying to lock these properties until they are unlocked. Properties must be unlocked before they are destroyed.

The lock is automatically taken when setting individual properties, this function is only needed when you want to set several properties atomically or want to guarantee that properties being queried aren't freed in another thread.

Parameters
propsthe properties to lock.
Returns
true on success or false on failure; call GetError() for more information.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Properties.Unlock

Constructor & Destructor Documentation

◆ ~PropertiesLock()

SDL::PropertiesLock::~PropertiesLock ( )
inline
Parameters
propsthe properties to unlock.
Thread safety:
It is safe to call this function from any thread.
Since
This function is available since SDL 3.2.0.
See also
Properties.Lock

The documentation for this class was generated from the following file: