diff --git a/emper/CountingPrivateSemaphore.cpp b/emper/CountingPrivateSemaphore.cpp index a74246a3ad540b112118fb6e8feefbe6065880bf..d66634c77a22d90f5adee0113aeaaf53412c852c 100644 --- a/emper/CountingPrivateSemaphore.cpp +++ b/emper/CountingPrivateSemaphore.cpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -// Copyright © 2020 Florian Schmaus +// Copyright © 2020-2021 Florian Schmaus #include "CountingPrivateSemaphore.hpp" #include <cassert> // for assert @@ -46,7 +46,7 @@ auto CountingPrivateSemaphore::signalInternal() -> Context* { // returns nullptr. In this case the block() function will // have won the race. Context* context = blockedContext.exchange(nullptr); - assert(context > (Context*)4096); + assert(!context || context > (Context*)4096); return context; }