[kaffe] CVS kaffe (guilhem): Small fix for threads.

Kaffe CVS cvs-commits at kaffe.org
Mon Oct 18 00:54:20 PDT 2004


PatchSet 5307 
Date: 2004/10/18 07:49:52
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Small fix for threads.

        * kaffe/kaffevm/thread.c
        (firstStartThread, createThread): Improved thread start
        synchronization.
        (createDaemon): Switched linkNativeAndJavaThread with waitStaticCond
        to prevent inconsistencies.
        (Reported by Helmer Kraemer <hkraemer at freenet.de>)

Members: 
	ChangeLog:1.2859->1.2860 
	kaffe/kaffevm/thread.c:1.76->1.77 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2859 kaffe/ChangeLog:1.2860
--- kaffe/ChangeLog:1.2859	Sun Oct 17 22:54:28 2004
+++ kaffe/ChangeLog	Mon Oct 18 07:49:52 2004
@@ -1,3 +1,12 @@
+2004-10-18  Guilhem Lavaux  <guilhem at kaffe.org>
+
+	* kaffe/kaffevm/thread.c
+	(firstStartThread, createThread): Improved thread start
+	synchronization.
+	(createDaemon): Switched linkNativeAndJavaThread with waitStaticCond
+	to prevent inconsistencies. 
+	(Reported by Helmer Kraemer <hkraemer at freenet.de>)
+
 2004-10-17  Dalibor Topic  <robilad at kaffe.org>
 
 	* kaffe/kaffevm/systems/unix-pthreads/thread-impl.c
Index: kaffe/kaffe/kaffevm/thread.c
diff -u kaffe/kaffe/kaffevm/thread.c:1.76 kaffe/kaffe/kaffevm/thread.c:1.77
--- kaffe/kaffe/kaffevm/thread.c:1.76	Sun Oct 17 14:38:30 2004
+++ kaffe/kaffe/kaffevm/thread.c	Mon Oct 18 07:49:58 2004
@@ -192,6 +192,7 @@
 
 	linkNativeAndJavaThread (nativeTid, tid);
 	
+	waitStaticCond(&thread_start_lock, (jlong)0);
 	unlockStaticMutex(&thread_start_lock);
 
 	if (nativeTid == NULL) {
@@ -369,9 +370,9 @@
   jthread_get_data(nativeTid)->exceptPtr = NULL;
   jthread_get_data(nativeTid)->exceptObj = NULL;
   
-  linkNativeAndJavaThread (nativeTid, vmtid);
-
   waitStaticCond(&thread_start_lock, (jlong)0);
+
+  linkNativeAndJavaThread (nativeTid, vmtid);
   
   unlockStaticMutex(&thread_start_lock);
   
@@ -396,6 +397,7 @@
 	ksemInit(&jthread_get_data(cur)->sem);
  
 	lockStaticMutex(&thread_start_lock);
+	signalStaticCond(&thread_start_lock);
 	unlockStaticMutex(&thread_start_lock);
 
 	tid = (Hjava_lang_VMThread *)(jthread_get_data(cur)->jlThread);




More information about the kaffe mailing list