Skip to content

Commit

Permalink
Relacy tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ccotter committed Sep 13, 2024
1 parent cddcd5a commit 7b202a1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/exec/__detail/__bwos_lifo_queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ namespace exec::bwos {
block_type(block_size, allocator),
allocator_of_t<block_type>(allocator))
, mask_(blocks_.size() - 1) {
blocks_[owner_block_].reclaim();
blocks_[owner_block_.load()].reclaim();
}

template <class Tp, class Allocator>
Expand Down Expand Up @@ -468,4 +468,4 @@ namespace exec::bwos {
auto lifo_queue<Tp, Allocator>::block_type::is_stealable() const noexcept -> bool {
return steal_tail_.load(std::memory_order_acquire) != block_size();
}
} // namespace exec::bwos
} // namespace exec::bwos
2 changes: 1 addition & 1 deletion include/exec/async_scope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ namespace exec {
// after this, which means we can rely on its self-ownership to ensure
// that it is eventually deleted
stdexec::start(
*new __op_t{nest(static_cast<_Sender&&>(__sndr)), static_cast<_Env&&>(__env), &__impl_});
*(new __op_t{nest(static_cast<_Sender&&>(__sndr)), static_cast<_Env&&>(__env), &__impl_}));
}

template <__movable_value _Env = empty_env, sender_in<__env_t<_Env>> _Sender>
Expand Down
2 changes: 1 addition & 1 deletion include/exec/start_now.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace exec {
}

void __complete() noexcept {
if (--__pending_ == 0) {
if (__pending_.fetch_sub(1) == 1) {
auto __joiner = __joiner_.exchange(nullptr);
if (__joiner) {
__joiner->join();
Expand Down
4 changes: 2 additions & 2 deletions include/stdexec/__detail/__when_all.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ namespace stdexec {

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

0 comments on commit 7b202a1

Please sign in to comment.