Skip to content

Remove trylock + unlock in acl_reset_condvar() #279

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

Merged
merged 1 commit into from
Feb 17, 2023
Merged
Changes from all commits
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
5 changes: 0 additions & 5 deletions lib/acl_threadsupport/src/acl_threadsupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,6 @@ void acl_reset_condvar(struct acl_condvar_s *C) {
#else
{
int ret = 0;
// Try to unlock then unlock. This is done just in case it is already
// locked, because if the mutex is locked we can't destroy it. This may
// happen in cases where an asssert causes an exit, etc.
pthread_mutex_trylock(&(C->waiter_mutex));
pthread_mutex_unlock(&(C->waiter_mutex));
ret |= pthread_mutex_destroy(&(C->waiter_mutex));
ret |= sem_destroy(&(C->signal_sem));
ret |= sem_destroy(&(C->passive_sem[0]));
Expand Down