From f46983d7ff937222c4d53142a93e36c219b77302 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Sat, 8 May 1999 18:49:24 +0200
Subject: [PATCH] Fixed bug in sanity check.

Rev: src/interpret.c:1.124
Rev: src/threads.c:1.95
---
 src/interpret.c | 11 +++++++----
 src/threads.c   | 14 +++++++++-----
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/src/interpret.c b/src/interpret.c
index 097d7d691c..3e41b23908 100644
--- a/src/interpret.c
+++ b/src/interpret.c
@@ -5,7 +5,7 @@
 \*/
 /**/
 #include "global.h"
-RCSID("$Id: interpret.c,v 1.123 1999/05/08 00:33:18 hubbe Exp $");
+RCSID("$Id: interpret.c,v 1.124 1999/05/08 16:42:48 grubba Exp $");
 #include "interpret.h"
 #include "object.h"
 #include "program.h"
@@ -652,12 +652,15 @@ void mega_apply2(enum apply_type type, INT32 args, void *arg1, void *arg2)
 #if defined(PIKE_DEBUG) && defined(_REENTRANT)
   if(d_flag)
     {
-      if( thread_id && !th_equal( OBJ2THREAD(thread_id)->id, th_self()) )
+      THREAD_T self = th_self();
+
+      if( thread_id && !th_equal( OBJ2THREAD(thread_id)->id, self) )
 	fatal("Current thread is wrong.\n");
 	
       if(thread_for_id(th_self()) != thread_id)
-	fatal("thread_for_id() (or thread_id) failed in mega_apply! %p != %p\n",thread_for_id(th_self()),thread_id);
-      }
+	fatal("thread_for_id() (or thread_id) failed in mega_apply! "
+	      "%p != %p\n", thread_for_id(self), thread_id);
+    }
 #endif
 
   switch(type)
diff --git a/src/threads.c b/src/threads.c
index 9252895d2d..cdf1bd38b2 100644
--- a/src/threads.c
+++ b/src/threads.c
@@ -1,5 +1,5 @@
 #include "global.h"
-RCSID("$Id: threads.c,v 1.94 1999/05/08 00:41:01 hubbe Exp $");
+RCSID("$Id: threads.c,v 1.95 1999/05/08 16:49:24 grubba Exp $");
 
 int num_threads = 1;
 int threads_disabled = 0;
@@ -503,12 +503,16 @@ TH_RETURN_TYPE new_thread_func(void * data)
 #if defined(PIKE_DEBUG)
   if(d_flag)
     {
-      if( thread_id && !th_equal( OBJ2THREAD(thread_id)->id, th_self()) )
-	fatal("Current thread is wrong. %x %x\n",OBJ2THREAD(thread_id)->id,th_self());
+      THREAD_T self = th_self();
+
+      if( thread_id && !th_equal( OBJ2THREAD(thread_id)->id, self) )
+	fatal("Current thread is wrong. %x %x\n",
+	      OBJ2THREAD(thread_id)->id, self);
 	
       if(thread_for_id(th_self()) != thread_id)
-	fatal("thread_for_id() (or thread_id) failed in new_thread_func! %p != %p\n",thread_for_id(th_self()),thread_id);
-      }
+	fatal("thread_for_id() (or thread_id) failed in new_thread_func! "
+	      "%p != %p\n", thread_for_id(self), thread_id);
+    }
 #endif
 
 #ifdef THREAD_TRACE
-- 
GitLab