Skip to content

Commit 7b202a1

Browse files
committed
Relacy tests
Instructions: git clone -b stdexec https://github.com/ccotter/relacy && cd relacy git clone -b relacy https://github.com/ccotter/stdexec CXX_STD=c++20 make build/test/stdexec/{async_scope_bug,split_bug} ./build/test/stdexec/split_bug
1 parent cddcd5a commit 7b202a1

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

include/exec/__detail/__bwos_lifo_queue.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ namespace exec::bwos {
152152
block_type(block_size, allocator),
153153
allocator_of_t<block_type>(allocator))
154154
, mask_(blocks_.size() - 1) {
155-
blocks_[owner_block_].reclaim();
155+
blocks_[owner_block_.load()].reclaim();
156156
}
157157

158158
template <class Tp, class Allocator>
@@ -468,4 +468,4 @@ namespace exec::bwos {
468468
auto lifo_queue<Tp, Allocator>::block_type::is_stealable() const noexcept -> bool {
469469
return steal_tail_.load(std::memory_order_acquire) != block_size();
470470
}
471-
} // namespace exec::bwos
471+
} // namespace exec::bwos

include/exec/async_scope.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ namespace exec {
781781
// after this, which means we can rely on its self-ownership to ensure
782782
// that it is eventually deleted
783783
stdexec::start(
784-
*new __op_t{nest(static_cast<_Sender&&>(__sndr)), static_cast<_Env&&>(__env), &__impl_});
784+
*(new __op_t{nest(static_cast<_Sender&&>(__sndr)), static_cast<_Env&&>(__env), &__impl_}));
785785
}
786786

787787
template <__movable_value _Env = empty_env, sender_in<__env_t<_Env>> _Sender>

include/exec/start_now.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ namespace exec {
7171
}
7272

7373
void __complete() noexcept {
74-
if (--__pending_ == 0) {
74+
if (__pending_.fetch_sub(1) == 1) {
7575
auto __joiner = __joiner_.exchange(nullptr);
7676
if (__joiner) {
7777
__joiner->join();

include/stdexec/__detail/__when_all.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ namespace stdexec {
191191

192192
template <class _Receiver>
193193
void __arrive(_Receiver& __rcvr) noexcept {
194-
if (0 == --__count_) {
194+
if (1 == __count_.fetch_sub(1)) {
195195
__complete(__rcvr);
196196
}
197197
}
@@ -361,7 +361,7 @@ namespace stdexec {
361361
} else if constexpr (!__same_as<decltype(_State::__values_), __ignore>) {
362362
// We only need to bother recording the completion values
363363
// if we're not already in the "error" or "stopped" state.
364-
if (__state.__state_ == __started) {
364+
if (__state.__state_.load() == __started) {
365365
auto& __opt_values = __tup::get<__v<_Index>>(__state.__values_);
366366
using _Tuple = __decayed_tuple<_Args...>;
367367
static_assert(

0 commit comments

Comments
 (0)