Skip to content

Commit

Permalink
thread: add cnd_destroy for posix and win32 (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers authored Jun 3, 2022
1 parent 12c130a commit 0d51f18
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/thread/posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ int cnd_wait(cnd_t *cnd, mtx_t *mtx)
}


void cnd_destroy(cnd_t *cnd)
{
if (!cnd)
return;

pthread_cond_destroy(cnd);
}


int mtx_init(mtx_t *mtx, int type)
{
pthread_mutexattr_t attr;
Expand Down
8 changes: 8 additions & 0 deletions src/thread/win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,14 @@ int cnd_wait(cnd_t *cnd, mtx_t *mtx)
}


void cnd_destroy(cnd_t *cnd)
{
if (!cnd)
return;
/* do nothing */
}


int mtx_init(mtx_t *mtx, int type)
{
(void)type;
Expand Down

0 comments on commit 0d51f18

Please sign in to comment.