diff options
Diffstat (limited to 'gcc/objc/thr-os2.c')
-rw-r--r-- | gcc/objc/thr-os2.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/gcc/objc/thr-os2.c b/gcc/objc/thr-os2.c index c36cad8..422d53e 100644 --- a/gcc/objc/thr-os2.c +++ b/gcc/objc/thr-os2.c @@ -1,5 +1,5 @@ /* GNU Objective C Runtime Thread Interface - OS/2 emx Implementation - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. Contributed by Thomas Baier (baier@ci.tuwien.ac.at) This file is part of GNU CC. @@ -50,9 +50,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. */ HMTX handle; /* OS/2 mutex HANDLE. */ }; @@ -86,7 +86,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) { int thread_id = 0; /* id of the newly created thread */ @@ -101,7 +101,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; } /******** @@ -191,10 +191,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) *_threadid; /* Return thread id. */ + return (objc_thread_t) *_threadid; /* Return thread id. */ } /******** @@ -222,17 +222,17 @@ 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 (DosCreateMutexSem (NULL,&(mutex->handle),0L,0) > 0) { - free (mutex); + objc_free(mutex); return NULL; } @@ -249,7 +249,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. */ @@ -270,9 +270,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. */ if (!mutex) /* Is argument bad? */ return -1; /* Yes, abort. */ @@ -295,9 +295,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. */ if (!mutex) /* Is argument bad? */ return -1; /* Yes, abort. */ @@ -320,9 +320,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. */ |