]> gcc.gnu.org Git - gcc.git/commitdiff
posix-threads.cc (_Jv_MutexLock): Moved back to posix-threads.h.
authorAnthony Green <green@cygnus.com>
Sun, 9 Apr 2000 05:41:56 +0000 (05:41 +0000)
committerAnthony Green <green@gcc.gnu.org>
Sun, 9 Apr 2000 05:41:56 +0000 (05:41 +0000)
2000-04-08  Anthony Green  <green@cygnus.com>

* posix-threads.cc (_Jv_MutexLock): Moved back to posix-threads.h.
(_Jv_MutexUnlock): Ditto.
* include/posix-threads.h (_Jv_MutexLock): From posix-threads.cc.
(_Jv_MutexUnlock): Ditto.

From-SVN: r33037

libjava/ChangeLog
libjava/include/posix-threads.h
libjava/posix-threads.cc

index e0a3a742279bb56abce69630007e7e07d34c0396..f282e0f84cd5e581a1472ffed4741419b0ecd20b 100644 (file)
@@ -1,3 +1,10 @@
+2000-04-08  Anthony Green  <green@cygnus.com>
+
+       * posix-threads.cc (_Jv_MutexLock): Moved back to posix-threads.h.
+       (_Jv_MutexUnlock): Ditto.
+       * include/posix-threads.h (_Jv_MutexLock): From posix-threads.cc.
+       (_Jv_MutexUnlock): Ditto.
+
 2000-04-08  Anthony Green  <green@cygnus.com>
 
        * java/lang/StringBuffer.java (ensureCapacity): Don't call Math::max.
index 22f6717e82db06422fe0dfc29043e286b34f7579..03a43906bd6fab4293d4f0fd44a5452214014b02 100644 (file)
@@ -115,8 +115,38 @@ _Jv_MutexInit (_Jv_Mutex_t *mu)
   mu->owner = 0;
 }
 
-int _Jv_MutexLock (_Jv_Mutex_t *mu);
-int _Jv_MutexUnlock (_Jv_Mutex_t *mu);
+inline int
+_Jv_MutexLock (_Jv_Mutex_t *mu)
+{
+  pthread_t self = pthread_self ();
+  if (mu->owner == self)
+    {
+      mu->count++;
+    }
+  else
+    {
+      pthread_mutex_lock (&mu->mutex);
+      mu->count = 1;
+      mu->owner = self;
+    }
+  return 0;
+}
+
+inline int
+_Jv_MutexUnlock (_Jv_Mutex_t *mu)
+{
+  if (_Jv_PthreadCheckMonitor (mu))
+    return _JV_NOT_OWNER;
+    
+  mu->count--;
+
+  if (mu->count == 0)
+    {
+      mu->owner = 0;
+      pthread_mutex_unlock (&mu->mutex);
+    }
+  return 0;
+}
 
 #ifndef LINUX_THREADS
 
index a664ee37060344c41c42a3edb78b48472b443290..e6b4b256720ce44197c8a531bb1fc27976017824 100644 (file)
@@ -402,39 +402,6 @@ _Jv_ThreadStart (java::lang::Thread *thread, _Jv_Thread_t *data,
     }
 }
 
-int
-_Jv_MutexLock (_Jv_Mutex_t *mu)
-{
-  pthread_t self = pthread_self ();
-  if (mu->owner == self)
-    {
-      mu->count++;
-    }
-  else
-    {
-      pthread_mutex_lock (&mu->mutex);
-      mu->count = 1;
-      mu->owner = self;
-    }
-  return 0;
-}
-
-int
-_Jv_MutexUnlock (_Jv_Mutex_t *mu)
-{
-  if (_Jv_PthreadCheckMonitor (mu))
-    return _JV_NOT_OWNER;
-    
-  mu->count--;
-
-  if (mu->count == 0)
-    {
-      mu->owner = 0;
-      pthread_mutex_unlock (&mu->mutex);
-    }
-  return 0;
-}
-
 void
 _Jv_ThreadWait (void)
 {
This page took 0.06449 seconds and 5 git commands to generate.