]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/gcc-tumbl.git/commitdiff
* mf-hooks3.c (main_seen_p): Remove.
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Aug 2005 20:26:46 +0000 (20:26 +0000)
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Aug 2005 20:26:46 +0000 (20:26 +0000)
(__mf_get_state): Remove attempt to recognize the main thread.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103119 138bc75d-0d04-0410-961f-82ee72b054a4

libmudflap/ChangeLog
libmudflap/mf-hooks3.c

index c42fa25360034306960a73e200a649c8554e9dd8..4bd53167e79ff7b6f082ce02e657e9b857c7316d 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-15  Ulrich Weigand  <weigand@informatik.uni-erlangen.de>
+
+       * mf-hooks3.c (main_seen_p): Remove.
+       (__mf_get_state): Remove attempt to recognize the main thread.
+
 2005-08-15  Maciej W. Rozycki  <macro@linux-mips.org>
 
        * configure.ac: Test for the name of the symbol used for the entry
index 73a7f717131851dc23d06a12dab0c4eae035c46c..e32f13a58efae5c1a6368b74f063358ab20a6d14 100644 (file)
@@ -104,11 +104,6 @@ struct mf_thread_data
 static struct mf_thread_data mf_thread_data[LIBMUDFLAPTH_THREADS_MAX];
 static pthread_mutex_t mf_thread_data_lock = PTHREAD_MUTEX_INITIALIZER;
 
-/* Try to identify the main thread when filling in mf_thread_data.  We
-   should always be called at least once from the main thread before 
-   any new threads are spawned.  */
-static int main_seen_p;
-
 #define PTHREAD_HASH(p) ((unsigned long) (p) % LIBMUDFLAPTH_THREADS_MAX)
 
 static struct mf_thread_data *
@@ -176,11 +171,9 @@ __mf_get_state (void)
   if (data)
     return data->state;
 
-  /* The main thread needs to default to active state, so that the global
-     constructors are processed in the active state.  Child threads should
-     be considered to be in the reentrant state, so that we don't wind up
-     doing Screwy Things inside the thread library; it'll get reset to 
-     active state in __mf_pthread_spawner before user code is invoked.
+  /* If we've never seen this thread before, consider it to be in the
+     reentrant state.  The state gets reset to active for the main thread
+     in __mf_init, and for child threads in __mf_pthread_spawner.
 
      The trickiest bit here is that the LinuxThreads pthread_manager thread
      should *always* be considered to be reentrant, so that none of our 
@@ -189,15 +182,7 @@ __mf_get_state (void)
      stuff isn't initialized, leading to SEGV very quickly.  Even calling
      pthread_self is a bit suspect, but it happens to work.  */
 
-  if (main_seen_p)
-    return reentrant;
-  else
-    {
-      main_seen_p = 1;
-      data = __mf_find_threadinfo (1);
-      data->state = active;
-      return active;
-    }
+  return reentrant;
 }
 
 void