summaryrefslogtreecommitdiff
path: root/src/unistd/sync.c
diff options
context:
space:
mode:
authorAlexey Izbyshev <izbyshev@ispras.ru>2022-09-08 12:18:56 +0300
committerRich Felker <dalias@aerifal.cx>2022-09-19 13:24:05 -0400
commit3ad3fa962efee12067d68c3405a537dce156a7ac (patch)
tree9e10fc277ba0851e2132bb3cc92a0d4738eea4aa /src/unistd/sync.c
parentbf14ef193b4203aa9a8b173faeeea06d98397f65 (diff)
downloadmusl-3ad3fa962efee12067d68c3405a537dce156a7ac.tar.gz
musl-3ad3fa962efee12067d68c3405a537dce156a7ac.tar.bz2
musl-3ad3fa962efee12067d68c3405a537dce156a7ac.tar.xz
musl-3ad3fa962efee12067d68c3405a537dce156a7ac.zip
fix thread leak on timer_create(SIGEV_THREAD) failure
After commit 5b74eed3b301e2227385f3bf26d3bb7c2d822cf8 the timer thread doesn't check whether timer_create() actually created the timer, proceeding to wait for a signal that might never arrive. We can't fix this by simply checking for a negative timer_id after pthread_barrier_wait() because we have no way to distinguish a timer creation failure and a request to delete a timer with INT_MAX id if it happens to arrive quickly (a variation of this bug existed before 5b74eed3b301e2227385f3bf26d3bb7c2d822cf8, where the timer would be leaked in this case). So (ab)use cancel field of pthread_t instead.
Diffstat (limited to 'src/unistd/sync.c')
0 files changed, 0 insertions, 0 deletions