Skip to content

Commit

Permalink
Properly initialize phtread mutexes in pkg repo.
Browse files Browse the repository at this point in the history
MacOS pthread is very sensitive to have phthread mutexes properly initialized, but it should be done everywhere.
  • Loading branch information
Keve authored and bapt committed Nov 13, 2024
1 parent b42190e commit f600043
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libpkg/pkg_repo_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,12 @@ pkg_repo_create(struct pkg_repo_create *prc, char *path)

te.meta = prc->meta;

/* initialize mutexes & conditions */
pthread_mutex_init(&te.nlock, 0);
pthread_mutex_init(&te.llock, 0);
pthread_mutex_init(&te.flock, 0);
pthread_cond_init(&te.cond, 0);

repopath[0] = path;
repopath[1] = NULL;

Expand Down

0 comments on commit f600043

Please sign in to comment.