changeset dcec9ee72f99 in /z/repo/m5threads
details: http://repo.gem5.org/m5threads?cmd=changeset;node=dcec9ee72f99
description:
        pthread_once: fix mutex_unlock to allow recursion

        Unlock the __once_mutex before calling the specified function
        to avoid deadlock on recursive calls, as apparently can
        happen in the C++ STL.

        Fix from Robert David <[email protected]>.

diffstat:

 pthread.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r c515685843c2 -r dcec9ee72f99 pthread.c
--- a/pthread.c Tue Sep 24 13:02:52 2013 -0600
+++ b/pthread.c Mon Mar 10 12:29:59 2014 -0700
@@ -716,8 +716,8 @@
     return 0;
   }
   *once = PTHREAD_ONCE_INIT+1;
+  pthread_mutex_unlock(&__once_mutex);
   init();
-  pthread_mutex_unlock(&__once_mutex);
   return 0;
 }
 
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to