Skip to content

Bind condvars to external mutex for POSIX waits#1

Closed
francdoc wants to merge 1 commit intofix-1391-condition-variable-logic-external-mutexfrom
codex/propose-improvements-to-osal-condvar-api
Closed

Bind condvars to external mutex for POSIX waits#1
francdoc wants to merge 1 commit intofix-1391-condition-variable-logic-external-mutexfrom
codex/propose-improvements-to-osal-condvar-api

Conversation

@francdoc
Copy link
Owner

Summary

  • update the POSIX condition variable implementation to look up the bound mutex for lock/unlock/wait operations and drop the private pthread mutex
  • adjust unit tests, coverage helpers, and stubs to supply the associated mutex when creating condition variables and clean up the mutexes

Testing

  • cmake -S . -B build
  • cmake --build build
  • ctest --test-dir build

https://chatgpt.com/codex/tasks/task_e_68d2f50965848321a590c8ce817a8226

@francdoc francdoc closed this Sep 23, 2025
@francdoc francdoc deleted the codex/propose-improvements-to-osal-condvar-api branch September 23, 2025 22:26
Comment on lines +117 to +118
if (OS_ObjectIdGetById(OS_LOCK_MODE_NONE, OS_OBJECT_TYPE_OS_MUTEX, condvar->bound_mutex, &mutex_token) !=
OS_SUCCESS)

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression Warning

This Boolean expression is not side-effect free.
Comment on lines +148 to +149
if (OS_ObjectIdGetById(OS_LOCK_MODE_NONE, OS_OBJECT_TYPE_OS_MUTEX, condvar->bound_mutex, &mutex_token) !=
OS_SUCCESS)

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression Warning

This Boolean expression is not side-effect free.
Comment on lines +224 to +225
if (OS_ObjectIdGetById(OS_LOCK_MODE_NONE, OS_OBJECT_TYPE_OS_MUTEX, condvar->bound_mutex, &mutex_token) !=
OS_SUCCESS)

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression Warning

This Boolean expression is not side-effect free.
Comment on lines +258 to +259
if (OS_ObjectIdGetById(OS_LOCK_MODE_NONE, OS_OBJECT_TYPE_OS_MUTEX, condvar->bound_mutex, &mutex_token) !=
OS_SUCCESS)

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression Warning

This Boolean expression is not side-effect free.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant