OSDN Git Service

(OBJC_VERSION): Increment version as recent changes have made old
[pf3gnuchains/gcc-fork.git] / gcc / objc / thr-win32.c
index 37e9876..520a91d 100644 (file)
@@ -1,5 +1,5 @@
 /* GNU Objective C Runtime Thread Interface - Win32 Implementation
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997 Free Software Foundation, Inc.
    Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
 
 This file is part of GNU CC.
@@ -38,9 +38,9 @@ Boston, MA 02111-1307, USA.  */
  *  provided by the system.  We augment it with depth and current owner id
  *  fields to implement and re-entrant lock.
  */
-struct _objc_mutex 
+struct objc_mutex 
 {
-  volatile _objc_thread_t       owner;         /* Id of thread that owns.  */
+  volatile objc_thread_t       owner;          /* Id of thread that owns.  */
   volatile int                  depth;          /* # of acquires.           */
   HANDLE                        handle;         /* Win32 mutex HANDLE.      */
 };
@@ -79,7 +79,7 @@ __objc_fini_thread_system(void)
  *  Create a new thread of execution and return its id.  Return NULL if fails.
  *  The new thread starts in "func" with the given argument.
  */
-_objc_thread_t
+objc_thread_t
 objc_thread_create(void (*func)(void *arg), void *arg)
 {
   DWORD                thread_id = 0;                  /* Detached thread id.      */
@@ -96,7 +96,7 @@ objc_thread_create(void (*func)(void *arg), void *arg)
   
   objc_mutex_unlock(__objc_runtime_mutex);
   
-  return (_objc_thread_t)thread_id;
+  return (objc_thread_t)thread_id;
 }
 
 /********
@@ -183,10 +183,10 @@ objc_thread_exit(void)
  *  Returns an integer value which uniquely describes a thread.  Must not be
  *  -1 which is reserved as a marker for "no thread".
  */
-_objc_thread_t
+objc_thread_t
 objc_thread_id(void)
 {
-  return (_objc_thread_t)GetCurrentThreadId();  /* Return thread id.        */
+  return (objc_thread_t)GetCurrentThreadId();  /* Return thread id.        */
 }
 
 /********
@@ -214,13 +214,13 @@ objc_thread_get_data(void)
  *  Allocate a mutex.  Return the mutex pointer if successful or NULL if
  *  the allocation fails for any reason.
  */
-_objc_mutex_t
+objc_mutex_t
 objc_mutex_allocate(void)
 {
-    _objc_mutex_t mutex;
+    objc_mutex_t mutex;
     int         err = 0;
 
-    if (!(mutex = (_objc_mutex_t) objc_malloc(sizeof(struct _objc_mutex))))
+    if (!(mutex = (objc_mutex_t)objc_malloc(sizeof(struct objc_mutex))))
         return NULL;                            /* Abort if malloc failed.  */
 
     if ((mutex->handle = CreateMutex(NULL, 0, NULL)) == NULL) {
@@ -240,7 +240,7 @@ objc_mutex_allocate(void)
  *  Returns the number of locks on the thread.  (1 for deallocate).
  */
 int
-objc_mutex_deallocate(_objc_mutex_t mutex)
+objc_mutex_deallocate(objc_mutex_t mutex)
 {
     int         depth;                          /* # of locks on mutex.     */
 
@@ -261,9 +261,9 @@ objc_mutex_deallocate(_objc_mutex_t mutex)
  *  Returns the lock count on the mutex held by this thread.
  */
 int
-objc_mutex_lock(_objc_mutex_t mutex)
+objc_mutex_lock(objc_mutex_t mutex)
 {
-    _objc_thread_t      thread_id;              /* Cache our thread id.     */
+    objc_thread_t      thread_id;              /* Cache our thread id.     */
     int                 status;
 
     if (!mutex)                                 /* Is argument bad?         */
@@ -287,9 +287,9 @@ objc_mutex_lock(_objc_mutex_t mutex)
  *  thread has a lock on the mutex returns -1.
  */
 int
-objc_mutex_trylock(_objc_mutex_t mutex)
+objc_mutex_trylock(objc_mutex_t mutex)
 {
-    _objc_thread_t      thread_id;              /* Cache our thread id.     */
+    objc_thread_t      thread_id;              /* Cache our thread id.     */
     DWORD               status;                 /* Return status from Win32.*/
 
     if (!mutex)                                 /* Is argument bad?         */
@@ -314,9 +314,9 @@ objc_mutex_trylock(_objc_mutex_t mutex)
  *  Will also return -1 if the mutex free fails.
  */
 int
-objc_mutex_unlock(_objc_mutex_t mutex)
+objc_mutex_unlock(objc_mutex_t mutex)
 {
-    _objc_thread_t      thread_id;              /* Cache our thread id.     */
+    objc_thread_t      thread_id;              /* Cache our thread id.     */
     
     if (!mutex)                                 /* Is argument bad?         */
         return -1;                              /* Yes, abort.              */