-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
HI,
https://github.com/PikoRT/pikoRT/blob/master/kernel/mutex.c#L14
int sys_pthread_mutex_lock(kernel_mutex_t *mutex)
{
mutex->val++;
if (!mutex->val)
return 0;
I'm pretty sure such code is not mutual exclusion.
It better to implement cmpxchg by ldrex or ldxr
Also, the tests for mutext_* are not test for mutual exclusion at all, they only test for the functions finish execution or not.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels