SDK: Fix data races on the local semaphores

This commit is contained in:
Dennis Klein
2019-09-01 15:44:52 +02:00
committed by Dennis Klein
parent 5d6184cd1a
commit 1c49dde668
5 changed files with 22 additions and 21 deletions

View File

@@ -30,11 +30,11 @@ struct Semaphore
auto Wait() -> void;
auto Signal() -> void;
auto GetCount() -> std::size_t;
auto GetCount() const -> std::size_t;
private:
std::size_t fCount;
std::mutex fMutex;
mutable std::mutex fMutex;
std::condition_variable fCv;
};
@@ -49,7 +49,7 @@ struct SharedSemaphore
auto Wait() -> void;
auto Signal() -> void;
auto GetCount() -> std::size_t;
auto GetCount() const -> std::size_t;
private:
std::shared_ptr<Semaphore> fSemaphore;