/*** Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved. File: RWLock.hpp Date: 2021-6-9 Author: Reece ***/ #pragma once namespace Aurora::Threading::Primitives { class RWLock { public: /** * @brief Returns a complete IWaitable interface for reantrant access to the protected resources. * Once a thread takes exclusive access of the resource, only it shall pass read * @return */ virtual IWaitable *AsReadable() = 0; /** * @brief Returns a complete IWaitable interface for exclusive thread access to the protected resources * * @return */ virtual IWaitable *AsWritable() = 0; /** * @brief Allows for read-to-write upgrades when the decision to esclate is made based upon a shared resource * @param timeout * @return */ virtual bool UpgradeReadToWrite(AuUInt64 timeout) = 0; }; AUKN_SHARED_API(RWLock, RWLock); }