Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error checking in mutex stub #3167

Open
wants to merge 3 commits into
base: devel
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix assertion cast argument types to be generic
  • Loading branch information
celskeggs committed Feb 14, 2025
commit 3707174fc3691e54bfd810ceeb361eca108f38b6
4 changes: 2 additions & 2 deletions Os/Mutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ Mutex::Status Mutex::release() {
void Mutex::lock() {
FW_ASSERT(&this->m_delegate == reinterpret_cast<MutexInterface*>(&this->m_handle_storage[0]));
Mutex::Status status = this->take();
FW_ASSERT(status == Mutex::Status::OP_OK, static_cast<U32>(reinterpret_cast<FwSizeType>(this)), status);
FW_ASSERT(status == Mutex::Status::OP_OK, static_cast<FwAssertArgType>(reinterpret_cast<PlatformPointerCastType>(this)), status);
}

void Mutex::unLock() {
FW_ASSERT(&this->m_delegate == reinterpret_cast<MutexInterface*>(&this->m_handle_storage[0]));
Mutex::Status status = this->release();
FW_ASSERT(status == Mutex::Status::OP_OK, static_cast<U32>(reinterpret_cast<FwSizeType>(this)), status);
FW_ASSERT(status == Mutex::Status::OP_OK, static_cast<FwAssertArgType>(reinterpret_cast<PlatformPointerCastType>(this)), status);
}

ScopeLock::ScopeLock(Mutex& mutex) : m_mutex(mutex) {
Expand Down
Loading