Skip to content

Commit

Permalink
cond,once,mutex,sem: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lhmouse committed Oct 12, 2024
1 parent 04221ad commit 79d7f72
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 5 deletions.
1 change: 0 additions & 1 deletion mcfgthread/cond.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ _MCF_cond_signal_some_slow(_MCF_cond* cond, size_t max)
/* Get the number of threads to wake up. */
size_t wake_num;
_MCF_cond old, new;

_MCF_atomic_load_pptr_rlx(&old, cond);
do {
new = old;
Expand Down
1 change: 0 additions & 1 deletion mcfgthread/mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ _MCF_mutex_unlock_slow(_MCF_mutex* mutex)
* further threads to spin. */
size_t wake_one;
_MCF_mutex old, new;

_MCF_atomic_load_pptr_rlx(&old, mutex);
do {
new = old;
Expand Down
1 change: 0 additions & 1 deletion mcfgthread/once.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ _MCF_once_abort(_MCF_once* once)
/* Clear the `__locked` field and release at most one thread, if any. */
size_t wake_one;
_MCF_once old, new;

_MCF_atomic_load_pptr_rlx(&old, once);
do {
new = old;
Expand Down
2 changes: 0 additions & 2 deletions mcfgthread/sem.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,12 @@ __MCF_DLLEXPORT __MCF_NEVER_INLINE
int
_MCF_sem_signal_some(_MCF_sem* sem, intptr_t value_add)
{
/* Validate arguments. */
if(value_add <= 0)
return (int) (value_add >> (__MCF_PTR_BITS - 1)); /* value_add ? -1 : 0 */

/* Get the number of threads to wake up. */
size_t wake_num;
_MCF_sem old, new;

_MCF_atomic_load_pptr_rlx(&old, sem);
do {
if(old.__value > __MCF_SEM_VALUE_MAX - value_add)
Expand Down

0 comments on commit 79d7f72

Please sign in to comment.