summaryrefslogtreecommitdiff
path: root/src/thread
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-08-23 23:35:10 -0400
committerRich Felker <dalias@aerifal.cx>2014-08-23 23:35:10 -0400
commit5345c9b884e7c4e73eb2c8bb83b8d0df20f95afb (patch)
tree622716518874799c9430d2542f5d063a5906c638 /src/thread
parentb8ca9eb5301580dcf101753451eee196edceefbd (diff)
downloadmusl-5345c9b884e7c4e73eb2c8bb83b8d0df20f95afb.tar.gz
musl-5345c9b884e7c4e73eb2c8bb83b8d0df20f95afb.tar.bz2
musl-5345c9b884e7c4e73eb2c8bb83b8d0df20f95afb.tar.xz
musl-5345c9b884e7c4e73eb2c8bb83b8d0df20f95afb.zip
fix false ownership of stdio FILEs due to tid reuse
this is analogous commit fffc5cda10e0c5c910b40f7be0d4fa4e15bb3f48 which fixed the corresponding issue for mutexes. the robust list can't be used here because the locks do not share a common layout with mutexes. at some point it may make sense to simply incorporate a mutex object into the FILE structure and use it, but that would be a much more invasive change, and it doesn't mesh well with the current design that uses a simpler code path for internal locking and pulls in the recursive-mutex-like code when the flockfile API is used explicitly.
Diffstat (limited to 'src/thread')
-rw-r--r--src/thread/pthread_create.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
index 1601614a..e441bdac 100644
--- a/src/thread/pthread_create.c
+++ b/src/thread/pthread_create.c
@@ -12,6 +12,7 @@ weak_alias(dummy_0, __acquire_ptc);
weak_alias(dummy_0, __release_ptc);
weak_alias(dummy_0, __pthread_tsd_run_dtors);
weak_alias(dummy_0, __do_private_robust_list);
+weak_alias(dummy_0, __do_orphaned_stdio_locks);
_Noreturn void pthread_exit(void *result)
{
@@ -66,6 +67,7 @@ _Noreturn void pthread_exit(void *result)
}
__do_private_robust_list();
+ __do_orphaned_stdio_locks();
if (self->detached && self->map_base) {
/* Detached threads must avoid the kernel clear_child_tid