diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-11-13 11:05:32 +0100 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-11-13 11:05:32 +0100 |
commit | 2f2f29391012949385631e5bee7c35fed71392dd (patch) | |
tree | 382a2bbaa7dcbf5bda3ca322626d29d539f6f738 /src/lane.hpp | |
parent | f2a3c033fc31332e78aa45d2d9deaf51359b584a (diff) | |
download | lanes-2f2f29391012949385631e5bee7c35fed71392dd.tar.gz lanes-2f2f29391012949385631e5bee7c35fed71392dd.tar.bz2 lanes-2f2f29391012949385631e5bee7c35fed71392dd.zip |
Cleaning up guano
* Lane::waiting on does not need to be volatile or anything else, all accesses are controlled through status acquire/release semantics
* this contains fixes about bad ordering of said accesses in Linda:send and Linda:receive
Diffstat (limited to 'src/lane.hpp')
-rw-r--r-- | src/lane.hpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lane.hpp b/src/lane.hpp index eb51aa3..b5be9ab 100644 --- a/src/lane.hpp +++ b/src/lane.hpp | |||
@@ -50,7 +50,6 @@ enum class WakeLane | |||
50 | Yes | 50 | Yes |
51 | }; | 51 | }; |
52 | 52 | ||
53 | // NOTE: values to be changed by either thread, during execution, without locking, are marked "volatile" | ||
54 | class Lane | 53 | class Lane |
55 | { | 54 | { |
56 | public: | 55 | public: |
@@ -118,9 +117,9 @@ class Lane | |||
118 | // M: sets to Pending (before launching) | 117 | // M: sets to Pending (before launching) |
119 | // S: updates -> Running/Waiting/Suspended -> Done/Error/Cancelled | 118 | // S: updates -> Running/Waiting/Suspended -> Done/Error/Cancelled |
120 | 119 | ||
121 | std::condition_variable* volatile waiting_on{ nullptr }; | 120 | // accessed under control of status acquire/release semantics |
122 | // | ||
123 | // When status is Waiting, points on the linda's signal the thread waits on, else nullptr | 121 | // When status is Waiting, points on the linda's signal the thread waits on, else nullptr |
122 | std::condition_variable* waiting_on{ nullptr }; | ||
124 | 123 | ||
125 | std::atomic<CancelRequest> cancelRequest{ CancelRequest::None }; | 124 | std::atomic<CancelRequest> cancelRequest{ CancelRequest::None }; |
126 | static_assert(std::atomic<CancelRequest>::is_always_lock_free); | 125 | static_assert(std::atomic<CancelRequest>::is_always_lock_free); |