summaryrefslogtreecommitdiff
path: root/libmudflap
diff options
context:
space:
mode:
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-14 19:38:34 +0000
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-14 19:38:34 +0000
commit55e575c08fe16651b986fb3dbb03441d3b638ffc (patch)
tree202dc3571b5024f7a8cfdd97d391485aae1bf2c1 /libmudflap
parentff77282cabdf300f9c85a8e559ea42b58de9fef2 (diff)
downloadgcc-55e575c08fe16651b986fb3dbb03441d3b638ffc.tar.gz
* mf-runtime.c (__mf_state_1): Initialize to reentrant.
(__mf_init): Set thread state active. * mf-hooks3.c (__mf_pthread_spawner): Always set thread state active. (pthread_create wrapper): Always use thread spawner. * testsuite/libmudflap.cth/pass37-frag.c: Increase timeout. * testsuite/libmudflap.cth/pass39-frag.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103084 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libmudflap')
-rw-r--r--libmudflap/ChangeLog11
-rw-r--r--libmudflap/mf-hooks3.c32
-rw-r--r--libmudflap/mf-runtime.c6
-rw-r--r--libmudflap/testsuite/libmudflap.cth/pass37-frag.c2
-rw-r--r--libmudflap/testsuite/libmudflap.cth/pass39-frag.c2
5 files changed, 24 insertions, 29 deletions
diff --git a/libmudflap/ChangeLog b/libmudflap/ChangeLog
index f9f13800468..ad616633dcb 100644
--- a/libmudflap/ChangeLog
+++ b/libmudflap/ChangeLog
@@ -1,3 +1,14 @@
+2005-08-14 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
+
+ * mf-runtime.c (__mf_state_1): Initialize to reentrant.
+ (__mf_init): Set thread state active.
+ * mf-hooks3.c (__mf_pthread_spawner): Always set thread
+ state active.
+ (pthread_create wrapper): Always use thread spawner.
+
+ * testsuite/libmudflap.cth/pass37-frag.c: Increase timeout.
+ * testsuite/libmudflap.cth/pass39-frag.c: Likewise.
+
2005-07-16 Richard Henderson <rth@redhat.com>
* acinclude.m4: New file.
diff --git a/libmudflap/mf-hooks3.c b/libmudflap/mf-hooks3.c
index f3006b20fe0..73a7f717131 100644
--- a/libmudflap/mf-hooks3.c
+++ b/libmudflap/mf-hooks3.c
@@ -245,9 +245,7 @@ __mf_pthread_spawner (void *arg)
{
void *result = NULL;
-#ifndef HAVE_TLS
__mf_set_state (active);
-#endif
/* NB: We could use __MF_TYPE_STATIC here, but we guess that the thread
errno is coming out of some dynamically allocated pool that we already
@@ -291,31 +289,15 @@ __mf_0fn_pthread_create (pthread_t *thr, const pthread_attr_t *attr,
WRAPPER(int, pthread_create, pthread_t *thr, const pthread_attr_t *attr,
void * (*start) (void *), void *arg)
{
- int result, need_wrapper = 0;
+ struct mf_thread_start_info *si;
TRACE ("pthread_create\n");
-#ifndef HAVE_TLS
- need_wrapper = 1;
-#endif
- need_wrapper |= __mf_opts.heur_std_data != 0;
-
- if (need_wrapper)
- {
- struct mf_thread_start_info *si = CALL_REAL (malloc, sizeof (*si));
-
- /* Fill in startup-control fields. */
- si->user_fn = start;
- si->user_arg = arg;
+ /* Fill in startup-control fields. */
+ si = CALL_REAL (malloc, sizeof (*si));
+ si->user_fn = start;
+ si->user_arg = arg;
- /* Actually create the thread. */
- result = CALL_REAL (pthread_create, thr, attr, __mf_pthread_spawner, si);
- }
- else
- {
- /* If we're not handling heur_std_data, nothing special to do. */
- result = CALL_REAL (pthread_create, thr, attr, start, arg);
- }
-
- return result;
+ /* Actually create the thread. */
+ return CALL_REAL (pthread_create, thr, attr, __mf_pthread_spawner, si);
}
diff --git a/libmudflap/mf-runtime.c b/libmudflap/mf-runtime.c
index af584e773d9..e6901650975 100644
--- a/libmudflap/mf-runtime.c
+++ b/libmudflap/mf-runtime.c
@@ -178,10 +178,10 @@ int __mf_starting_p = 1;
#ifdef LIBMUDFLAPTH
#ifdef HAVE_TLS
-__thread enum __mf_state_enum __mf_state_1 = active;
+__thread enum __mf_state_enum __mf_state_1 = reentrant;
#endif
#else
-enum __mf_state_enum __mf_state_1 = active;
+enum __mf_state_enum __mf_state_1 = reentrant;
#endif
#ifdef LIBMUDFLAPTH
@@ -697,6 +697,8 @@ __mf_init ()
#endif
__mf_starting_p = 0;
+ __mf_set_state (active);
+
__mf_set_default_options ();
ov = getenv ("MUDFLAP_OPTIONS");
diff --git a/libmudflap/testsuite/libmudflap.cth/pass37-frag.c b/libmudflap/testsuite/libmudflap.cth/pass37-frag.c
index bfa2c7c02ab..877803c1ea0 100644
--- a/libmudflap/testsuite/libmudflap.cth/pass37-frag.c
+++ b/libmudflap/testsuite/libmudflap.cth/pass37-frag.c
@@ -55,4 +55,4 @@ int main ()
/* { dg-output "100 100 100 100 100 100 100 100 100 100" } */
/* { dg-repetitions 20 } */
-/* { dg-timeout 3 } */
+/* { dg-timeout 10 } */
diff --git a/libmudflap/testsuite/libmudflap.cth/pass39-frag.c b/libmudflap/testsuite/libmudflap.cth/pass39-frag.c
index eb3449e9d8b..cd3eb5abdaf 100644
--- a/libmudflap/testsuite/libmudflap.cth/pass39-frag.c
+++ b/libmudflap/testsuite/libmudflap.cth/pass39-frag.c
@@ -54,4 +54,4 @@ int main ()
}
/* { dg-output "100 100 100 100 100 100 100 100 100 100" } */
/* { dg-repetitions 20 } */
-/* { dg-timeout 3 } */
+/* { dg-timeout 10 } */