View source code
Display the source code in core/sync/rwmutex.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

core.sync.rwmutex.ReadWriteMutex.Policy/policy - multiple declarations

Function ReadWriteMutex.policy

Gets the policy used by this mutex.

ReadWriteMutex.Policy policy() nothrow @property @safe;

ReadWriteMutex.Policy policy() nothrow @property @safe shared;

Returns

The policy used by this mutex.

Enum ReadWriteMutex.Policy

Defines the policy used by this mutex. Currently, two policies are defined.

enum Policy : int { ... }

The first will queue writers until no readers hold the mutex, then pass the writers through one at a time. If a reader acquires the mutex while there are still writers queued, the reader will take precedence.

The second will queue readers if there are any writers queued. Writers are passed through one at a time, and once there are no writers present, all queued readers will be alerted.

Future policies may offer a more even balance between reader and writer precedence.

Enum members

NameDescription
PREFER_READERS Readers get preference. This may starve writers.
PREFER_WRITERS Writers get preference. This may starve readers.

Authors

Sean Kelly

License

Boost License 1.0