[kaffe] CVS kaffe (robilad): Locking fixes for amd64

Kaffe CVS cvs-commits at kaffe.org
Sun Dec 25 12:46:47 PST 2005


PatchSet 7053 
Date: 2005/12/25 20:40:28
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Locking fixes for amd64

2005-12-25  Guilhem Lavaux  <guilhem at kaffe.org>

        * kaffe/kaffevm/locks.c (putHeavyLock): Use atomic ops to assign hLockHolder
        and in_progress.

2005-12-25  Dalibor Topic  <robilad at kaffe.org>

        * kaffe/kaffevm/locks.h (struct _iLock): Made holder volatile to fix compiler warnings.

        * kaffe/kaffevm/locks.c (locks_internal_slowUnlockMutexIfHeld, locks_internal_waitCond):
        Made holder volatile to fix compiler warnings.

Members: 
	ChangeLog:1.4571->1.4572 
	kaffe/kaffevm/locks.c:1.67->1.68 
	kaffe/kaffevm/locks.h:1.31->1.32 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4571 kaffe/ChangeLog:1.4572
--- kaffe/ChangeLog:1.4571	Sun Dec 25 18:10:01 2005
+++ kaffe/ChangeLog	Sun Dec 25 20:40:28 2005
@@ -1,3 +1,15 @@
+2005-12-25  Guilhem Lavaux  <guilhem at kaffe.org>
+
+	* kaffe/kaffevm/locks.c (putHeavyLock): Use atomic ops to assign hLockHolder
+	and in_progress.
+
+2005-12-25  Dalibor Topic  <robilad at kaffe.org>
+
+	* kaffe/kaffevm/locks.h (struct _iLock): Made holder volatile to fix compiler warnings.
+
+	* kaffe/kaffevm/locks.c (locks_internal_slowUnlockMutexIfHeld, locks_internal_waitCond):
+	Made holder volatile to fix compiler warnings.
+
 2005-12-25  Dalibor Topic  <robilad at kaffe.org>
 
 	* configure.ac: (--disable-classpath-tools) Added switch to disable 
Index: kaffe/kaffe/kaffevm/locks.c
diff -u kaffe/kaffe/kaffevm/locks.c:1.67 kaffe/kaffe/kaffevm/locks.c:1.68
--- kaffe/kaffe/kaffevm/locks.c:1.67	Sun Dec 18 10:39:55 2005
+++ kaffe/kaffe/kaffevm/locks.c	Sun Dec 25 20:40:33 2005
@@ -203,8 +203,8 @@
 
   assert(lk->in_progress == 1);
   
-  lk->hlockHolder = NULL;
-  lk->in_progress = 0;
+  atomic_exchange_acq(&(lk->hlockHolder), NULL);
+  atomic_exchange_acq(&(lk->in_progress), 0);
   if (lk->num_wait != 0)
     KSEM(put)(&(lk->sem));
 }
@@ -323,7 +323,7 @@
 locks_internal_slowUnlockMutexIfHeld(iLock** lkp, iLock *heavyLock)
 {
   volatile iLock* lk;
-  void* holder;
+  volatile void* holder;
   jthread_t cur = KTHREAD(current)();
   
   DBG(SLOWLOCKS,
@@ -355,7 +355,7 @@
 locks_internal_waitCond(iLock** lkp, iLock *heavyLock, jlong timeout)
 {
   volatile iLock* lk;
-  void* holder;
+  volatile void* holder;
   jthread_t cur = KTHREAD(current)();
   volatile jthread_t *ptr;
   jboolean r;
Index: kaffe/kaffe/kaffevm/locks.h
diff -u kaffe/kaffe/kaffevm/locks.h:1.31 kaffe/kaffe/kaffevm/locks.h:1.32
--- kaffe/kaffe/kaffevm/locks.h:1.31	Sun Dec 18 10:39:55 2005
+++ kaffe/kaffe/kaffevm/locks.h	Sun Dec 25 20:40:33 2005
@@ -45,14 +45,14 @@
  * unlock and for distinguishing recursive invocations).
  */
 typedef struct _iLock {
-  uintp         in_progress;
-  uintp         num_wait;
-  void*		holder;
-  jthread_t	mux;
-  jthread_t	cv;
-  Ksem          sem;
-  uint32        lockCount;
-  void*	hlockHolder;
+  uintp         	in_progress;
+  uintp         	num_wait;
+  volatile void*	holder;
+  jthread_t		mux;
+  jthread_t		cv;
+  Ksem          	sem;
+  uint32        	lockCount;
+  void*			hlockHolder;
 } iLock;
 
 typedef struct _iStaticLock {




More information about the kaffe mailing list