From b377d7386dfad6e5ec632249d8806b8432c8b0db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Fri, 7 Jul 2000 15:19:48 +0200 Subject: [PATCH] Now temporarily disables the fp macro since it conflicts with Solaris's <pthread.h>. Added time_base to the thread_state struct to support PROFILING. Rev: src/threads.h:1.96 --- src/threads.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/threads.h b/src/threads.h index 85725ce484..207bd1a634 100644 --- a/src/threads.h +++ b/src/threads.h @@ -1,5 +1,5 @@ /* - * $Id: threads.h,v 1.95 2000/07/07 00:21:48 hubbe Exp $ + * $Id: threads.h,v 1.96 2000/07/07 13:19:48 grubba Exp $ */ #ifndef THREADS_H #define THREADS_H @@ -9,8 +9,6 @@ #include "error.h" #include "interpret.h" -struct Pike_interpreter; - /* Needed for the sigset_t typedef, which is needed for * the pthread_sigsetmask() prototype on Solaris 2.x. */ @@ -22,6 +20,12 @@ struct Pike_interpreter; #endif /* HAVE_SYS_TYPES_H */ #ifdef PIKE_THREADS +/* The fp macro conflicts with Solaris's <pthread.h>. */ +#ifdef fp +#undef fp +#define FRAMEPOINTER_WAS_DEFINED +#endif /* fp */ + /* * Decide which type of threads to use * @@ -341,6 +345,9 @@ struct thread_state { THREAD_T id; struct mapping *thread_local; struct thread_state *hashlink, **backlink; +#ifdef PROFILING + long long time_base; +#endif /* PROFILING */ }; @@ -449,7 +456,9 @@ struct thread_state { DO_IF_DEBUG({ \ extern int Pike_in_gc; \ if(thread_for_id(th_self()) != Pike_interpreter.thread_id) \ - fatal("thread_for_id() (or Pike_interpreter.thread_id) failed! %p != %p\n",thread_for_id(th_self()),Pike_interpreter.thread_id); \ + fatal("thread_for_id() (or Pike_interpreter.thread_id) failed!" \ + " %p != %p\n", \ + thread_for_id(th_self()), Pike_interpreter.thread_id); \ if (Pike_in_gc > 50 && Pike_in_gc < 300) \ fatal("Threads allowed during garbage collection.\n"); \ }) \ @@ -621,6 +630,14 @@ void th_farm(void (*fun)(void *), void *here); #define init_threads_disable(X) #define exit_threads_disable(X) + +/* Restore the fp macro. */ +#ifdef FRAMEPOINTER_WAS_DEFINED +#define fp Pike_fp +#undef FRAMEPOINTER_WAS_DEFINED +#endif /* FRAMEPOINTER_WAS_DEFINED */ + + #endif /* PIKE_THREADS */ #ifndef CHECK_INTERPRETER_LOCK -- GitLab