View source code Display the source code in core/sync/rwmutex.d from which this page was generated on github. 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. Page wiki View or edit the community-maintained wiki page associated with this page.

core.sync.rwmutex.read_write_mutex.policy - multiple declarations

Function ReadWriteMutex.policy

Gets the policy used by this mutex.

Prototype

ReadWriteMutex.Policy policy() @property;

Returns

The policy used by this mutex.

Enum ReadWriteMutex.Policy

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

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.

The enum base type is int .

Enum members

Name Description
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

Comments