Simulation Modeling Tool Kit
Public Member Functions | List of all members
smtk::resource::Lock Class Reference

A read/write lock for resources. More...

#include <Lock.h>

Public Member Functions

 Lock (const Lock &)=delete
Lockoperator= (const Lock &)=delete
SMTKCORE_EXPORT void lock (LockType)
SMTKCORE_EXPORT bool tryLock (LockType)
SMTKCORE_EXPORT void unlock (LockType)
SMTKCORE_EXPORT LockType state () const

Detailed Description

A read/write lock for resources.

This lock is designed to potentially starve readers in favor of writers. This is not necessarily bad; it means that writers are given priority over readers when there are multiple readers and writers simultaneously attempting to access the resource.

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