You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
posix: pthread: rewrite of create, join, detach, cancel, and exit
Previously, the pthread implementation used a `pthread_mutex_t`
to synchronize thread state. This was required because a
`pthread_cond_t` was used to notify other pthreads that were
attempting to join or exit the same pthread.
With the previous removal of the `pthread_cond_t` from
`struct posix_thread`, and the addition of the
`z_thread_wake_joiners()` utility, there is no longer a need
to utilize a `pthread_mutex_t` to synchronize state.
Instead, use a `struct k_spinlock` for synchronization and
`z_thread_wake_joiners()` for notification.
Additionally, use a `bitarray` instead of the the
`pthread_pool_lock`, which makes `pthread.c` resource
allocation more like that of the other pthread objects.
Signed-off-by: Christopher Friedt <[email protected]>
0 commit comments