Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/tests/libexec/ld.elf_so Pull up following revision(s) (re...



details:   https://anonhg.NetBSD.org/src/rev/a6a118a60f5b
branches:  netbsd-8
changeset: 850997:a6a118a60f5b
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Sep 01 08:43:22 2017 +0000

description:
Pull up following revision(s) (requested by joerg in ticket #253):
        tests/libexec/ld.elf_so/h_thread_local_dtor.c: revision 1.2
Avoid a race condition between dlclose and thread termination.

diffstat:

 tests/libexec/ld.elf_so/h_thread_local_dtor.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (26 lines):

diff -r b3c49b41a198 -r a6a118a60f5b tests/libexec/ld.elf_so/h_thread_local_dtor.c
--- a/tests/libexec/ld.elf_so/h_thread_local_dtor.c     Thu Aug 31 11:48:21 2017 +0000
+++ b/tests/libexec/ld.elf_so/h_thread_local_dtor.c     Fri Sep 01 08:43:22 2017 +0000
@@ -75,10 +75,6 @@
        pthread_cond_wait(&cond1, &mutex);
        pthread_mutex_unlock(&mutex);
 
-       pthread_mutex_lock(&mutex);
-       pthread_cond_signal(&cond2);
-       pthread_mutex_unlock(&mutex);
-
        printf("before dlclose\n");
        dlclose(dso);
        printf("after dlclose\n");
@@ -86,6 +82,11 @@
        if (dso == NULL)
                errx(1, "%s", dlerror());
        dlclose(dso);
+
+       pthread_mutex_lock(&mutex);
+       pthread_cond_signal(&cond2);
+       pthread_mutex_unlock(&mutex);
+
        if (pthread_join(thread, NULL))
                err(1, "pthread_join");
        return 0;



Home | Main Index | Thread Index | Old Index