Skip to content
Snippets Groups Projects

[CountingPrivateSemaphore] Fix assert

Merged Florian Schmaus requested to merge flow/emper:cps-assert-fix into master
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
// SPDX-License-Identifier: LGPL-3.0-or-later
// SPDX-License-Identifier: LGPL-3.0-or-later
// Copyright © 2020 Florian Schmaus
// Copyright © 2020-2021 Florian Schmaus
#include "CountingPrivateSemaphore.hpp"
#include "CountingPrivateSemaphore.hpp"
#include <cassert> // for assert
#include <cassert> // for assert
@@ -46,7 +46,7 @@ auto CountingPrivateSemaphore::signalInternal() -> Context* {
@@ -46,7 +46,7 @@ auto CountingPrivateSemaphore::signalInternal() -> Context* {
// returns nullptr. In this case the block() function will
// returns nullptr. In this case the block() function will
// have won the race.
// have won the race.
Context* context = blockedContext.exchange(nullptr);
Context* context = blockedContext.exchange(nullptr);
assert(context > (Context*)4096);
assert(!context || context > (Context*)4096);
return context;
return context;
}
}
Loading