[kaffe] CVS kaffe (guilhem): Fixed some warnings and an optimization problem in locks.c.

Kaffe CVS cvs-commits at kaffe.org
Tue Aug 31 08:28:26 PDT 2004


PatchSet 5128 
Date: 2004/08/31 15:24:40
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Fixed some warnings and an optimization problem in locks.c.

        * kaffe/kaffevm/locks.c
        (getHeavyLock): Marked "*lkp" as volatile. Use LOCKFREE instead of 0
        for clarity.
        (slowLockMutex, locks_internal_waitCond): Cast explicitly 0 to jlong.

Members: 
	ChangeLog:1.2684->1.2685 
	kaffe/kaffevm/locks.c:1.50->1.51 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2684 kaffe/ChangeLog:1.2685
--- kaffe/ChangeLog:1.2684	Tue Aug 31 11:42:19 2004
+++ kaffe/ChangeLog	Tue Aug 31 15:24:40 2004
@@ -1,3 +1,10 @@
+2004-08-31  Guilhem Lavaux  <guilhem at kaffe.org>
+
+	* kaffe/kaffevm/locks.c
+	(getHeavyLock): Marked "*lkp" as volatile. Use LOCKFREE instead of 0
+	for clarity.
+	(slowLockMutex, locks_internal_waitCond): Cast explicitly 0 to jlong.
+
 2004-08-31  Dalibor Topic  <robilad at kaffe.org>
 
 	* kaffe/kaffevm/kaffe-gc/gc-mem.h: 
Index: kaffe/kaffe/kaffevm/locks.c
diff -u kaffe/kaffe/kaffevm/locks.c:1.50 kaffe/kaffe/kaffevm/locks.c:1.51
--- kaffe/kaffe/kaffevm/locks.c:1.50	Sat Jul 17 07:57:14 2004
+++ kaffe/kaffe/kaffevm/locks.c	Tue Aug 31 15:24:42 2004
@@ -74,7 +74,7 @@
  */
 static
 iLock*
-getHeavyLock(iLock** lkp, iLock *heavyLock)
+getHeavyLock(iLock* volatile * lkp, iLock *heavyLock)
 {
 	iLock* old;
 	iLock* lk;
@@ -113,7 +113,7 @@
 			lk = (iLock*)(((uintp)old) & (uintp)-2);
 		}
 		else {
-			if (lk == 0) {
+			if (lk == LOCKFREE) {
 				/* Release the lock before we go into malloc.
 				 * We have to reclaim the lock afterwards (at beginning
 				 * of loop)
@@ -197,7 +197,7 @@
 		jthread_get_data(cur)->nextlk = lk->mux;
 		lk->mux = cur;
 		putHeavyLock(lkp, lk);
-		ksemGet(&jthread_get_data(cur)->sem, 0);
+		ksemGet(&jthread_get_data(cur)->sem, (jlong)0);
 	}
 }
 
@@ -347,7 +347,7 @@
 		/* Not on list - so must have been signalled after all -
 		 * decrease the semaphore to avoid problems.
 		 */
-		ksemGet(&jthread_get_data(cur)->sem, 0);
+		ksemGet(&jthread_get_data(cur)->sem, (jlong)0);
 
 		found:;
 		putHeavyLock(lkp, lk);




More information about the kaffe mailing list