Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::svg::DocumentAccessLock Class Reference

Lightweight reader/writer gate for document access. More...

#include "donner/svg/DocumentState.h"

Public Member Functions

void lockRead ()
 Acquire shared read access.
bool tryLockRead ()
 Attempt to acquire shared read access without waiting for a writer.
void unlockRead ()
 Release shared read access.
void lockWrite () DONNER_NO_THREAD_SAFETY_ANALYSIS
 Acquire exclusive write access.
bool tryLockWrite () DONNER_NO_THREAD_SAFETY_ANALYSIS
 Try to acquire exclusive write access without waiting.
bool tryUpgradeReadToWrite () DONNER_NO_THREAD_SAFETY_ANALYSIS
 Try to atomically convert the calling thread's sole read lock to a write lock.
void downgradeWriteToRead () DONNER_NO_THREAD_SAFETY_ANALYSIS
 Atomically convert the calling thread's write lock to a read lock.
void unlockWrite () DONNER_NO_THREAD_SAFETY_ANALYSIS
 Release exclusive write access.

Detailed Description

Lightweight reader/writer gate for document access.

Member Function Documentation

◆ tryUpgradeReadToWrite()

bool donner::svg::DocumentAccessLock::tryUpgradeReadToWrite ( )
inlinenodiscard

Try to atomically convert the calling thread's sole read lock to a write lock.

This operation never waits. On failure, the caller retains its read lock unchanged.


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