Commit 71287280 by Kazu Hirata Committed by Kazu Hirata

gthr-dce.h: Fix comment formatting.

	* gthr-dce.h: Fix comment formatting.
	* gthr-posix.h: Likewise.
	* gthr-single.h: Likewise.
	* gthr-solaris.h: Likewise.
	* gthr-vxworks.h: Likewise.
	* gthr-win32.h: Likewise.

From-SVN: r46229
parent 8554d9a4
2001-10-12 Kazu Hirata <kazu@hxi.com>
* gthr-dce.h: Fix comment formatting.
* gthr-posix.h: Likewise.
* gthr-single.h: Likewise.
* gthr-solaris.h: Likewise.
* gthr-vxworks.h: Likewise.
* gthr-win32.h: Likewise.
2001-10-12 Jakub Jelinek <jakub@redhat.com> 2001-10-12 Jakub Jelinek <jakub@redhat.com>
* final.c (output_asm_insn): Make sure assembly dialects are * final.c (output_asm_insn): Make sure assembly dialects are
......
...@@ -31,7 +31,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -31,7 +31,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* DCE threads interface. /* DCE threads interface.
DCE threads are based on POSIX threads draft 4, and many things DCE threads are based on POSIX threads draft 4, and many things
have changed since then. */ have changed since then. */
#define __GTHREADS 1 #define __GTHREADS 1
...@@ -68,7 +68,7 @@ typedef pthread_mutex_t __gthread_mutex_t; ...@@ -68,7 +68,7 @@ typedef pthread_mutex_t __gthread_mutex_t;
#pragma weak pthread_mutex_unlock #pragma weak pthread_mutex_unlock
#ifdef _LIBOBJC #ifdef _LIBOBJC
/* Objective C. */ /* Objective C. */
#pragma weak pthread_cond_broadcast #pragma weak pthread_cond_broadcast
#pragma weak pthread_cond_destroy #pragma weak pthread_cond_destroy
#pragma weak pthread_cond_init #pragma weak pthread_cond_init
...@@ -109,7 +109,7 @@ static void *thread_local_storage = NULL; ...@@ -109,7 +109,7 @@ static void *thread_local_storage = NULL;
/* Backend initialization functions */ /* Backend initialization functions */
/* Initialize the threads subsystem. */ /* Initialize the threads subsystem. */
static inline int static inline int
__gthread_objc_init_thread_system(void) __gthread_objc_init_thread_system(void)
{ {
...@@ -120,7 +120,7 @@ __gthread_objc_init_thread_system(void) ...@@ -120,7 +120,7 @@ __gthread_objc_init_thread_system(void)
return -1; return -1;
} }
/* Close the threads subsystem. */ /* Close the threads subsystem. */
static inline int static inline int
__gthread_objc_close_thread_system(void) __gthread_objc_close_thread_system(void)
{ {
...@@ -132,7 +132,7 @@ __gthread_objc_close_thread_system(void) ...@@ -132,7 +132,7 @@ __gthread_objc_close_thread_system(void)
/* Backend thread functions */ /* Backend thread functions */
/* Create a new thread of execution. */ /* Create a new thread of execution. */
static inline objc_thread_t static inline objc_thread_t
__gthread_objc_thread_detach(void (*func)(void *), void *arg) __gthread_objc_thread_detach(void (*func)(void *), void *arg)
{ {
...@@ -147,7 +147,7 @@ __gthread_objc_thread_detach(void (*func)(void *), void *arg) ...@@ -147,7 +147,7 @@ __gthread_objc_thread_detach(void (*func)(void *), void *arg)
{ {
/* ??? May not work! (64bit) */ /* ??? May not work! (64bit) */
thread_id = *(objc_thread_t *)&new_thread_handle; thread_id = *(objc_thread_t *)&new_thread_handle;
pthread_detach(&new_thread_handle); /* Fully detach thread. */ pthread_detach(&new_thread_handle); /* Fully detach thread. */
} }
else else
thread_id = NULL; thread_id = NULL;
...@@ -155,7 +155,7 @@ __gthread_objc_thread_detach(void (*func)(void *), void *arg) ...@@ -155,7 +155,7 @@ __gthread_objc_thread_detach(void (*func)(void *), void *arg)
return thread_id; return thread_id;
} }
/* Set the current thread's priority. */ /* Set the current thread's priority. */
static inline int static inline int
__gthread_objc_thread_set_priority(int priority) __gthread_objc_thread_set_priority(int priority)
{ {
...@@ -178,7 +178,7 @@ __gthread_objc_thread_set_priority(int priority) ...@@ -178,7 +178,7 @@ __gthread_objc_thread_set_priority(int priority)
break; break;
} }
/* Change the priority. */ /* Change the priority. */
if (pthread_setprio(pthread_self(), sys_priority) >= 0) if (pthread_setprio(pthread_self(), sys_priority) >= 0)
return 0; return 0;
else else
...@@ -186,7 +186,7 @@ __gthread_objc_thread_set_priority(int priority) ...@@ -186,7 +186,7 @@ __gthread_objc_thread_set_priority(int priority)
return -1; return -1;
} }
/* Return the current thread's priority. */ /* Return the current thread's priority. */
static inline int static inline int
__gthread_objc_thread_get_priority(void) __gthread_objc_thread_get_priority(void)
{ {
...@@ -212,7 +212,7 @@ __gthread_objc_thread_get_priority(void) ...@@ -212,7 +212,7 @@ __gthread_objc_thread_get_priority(void)
return OBJC_THREAD_INTERACTIVE_PRIORITY; return OBJC_THREAD_INTERACTIVE_PRIORITY;
} }
/* Yield our process time to another thread. */ /* Yield our process time to another thread. */
static inline void static inline void
__gthread_objc_thread_yield(void) __gthread_objc_thread_yield(void)
{ {
...@@ -220,7 +220,7 @@ __gthread_objc_thread_yield(void) ...@@ -220,7 +220,7 @@ __gthread_objc_thread_yield(void)
pthread_yield(); pthread_yield();
} }
/* Terminate the current thread. */ /* Terminate the current thread. */
static inline int static inline int
__gthread_objc_thread_exit(void) __gthread_objc_thread_exit(void)
{ {
...@@ -232,7 +232,7 @@ __gthread_objc_thread_exit(void) ...@@ -232,7 +232,7 @@ __gthread_objc_thread_exit(void)
return -1; return -1;
} }
/* Returns an integer value which uniquely describes a thread. */ /* Returns an integer value which uniquely describes a thread. */
static inline objc_thread_t static inline objc_thread_t
__gthread_objc_thread_id(void) __gthread_objc_thread_id(void)
{ {
...@@ -246,7 +246,7 @@ __gthread_objc_thread_id(void) ...@@ -246,7 +246,7 @@ __gthread_objc_thread_id(void)
return (objc_thread_t)1; return (objc_thread_t)1;
} }
/* Sets the thread's local storage pointer. */ /* Sets the thread's local storage pointer. */
static inline int static inline int
__gthread_objc_thread_set_data(void *value) __gthread_objc_thread_set_data(void *value)
{ {
...@@ -259,7 +259,7 @@ __gthread_objc_thread_set_data(void *value) ...@@ -259,7 +259,7 @@ __gthread_objc_thread_set_data(void *value)
} }
} }
/* Returns the thread's local storage pointer. */ /* Returns the thread's local storage pointer. */
static inline void * static inline void *
__gthread_objc_thread_get_data(void) __gthread_objc_thread_get_data(void)
{ {
...@@ -278,7 +278,7 @@ __gthread_objc_thread_get_data(void) ...@@ -278,7 +278,7 @@ __gthread_objc_thread_get_data(void)
/* Backend mutex functions */ /* Backend mutex functions */
/* Allocate a mutex. */ /* Allocate a mutex. */
static inline int static inline int
__gthread_objc_mutex_allocate(objc_mutex_t mutex) __gthread_objc_mutex_allocate(objc_mutex_t mutex)
{ {
...@@ -298,7 +298,7 @@ __gthread_objc_mutex_allocate(objc_mutex_t mutex) ...@@ -298,7 +298,7 @@ __gthread_objc_mutex_allocate(objc_mutex_t mutex)
return 0; return 0;
} }
/* Deallocate a mutex. */ /* Deallocate a mutex. */
static inline int static inline int
__gthread_objc_mutex_deallocate(objc_mutex_t mutex) __gthread_objc_mutex_deallocate(objc_mutex_t mutex)
{ {
...@@ -314,7 +314,7 @@ __gthread_objc_mutex_deallocate(objc_mutex_t mutex) ...@@ -314,7 +314,7 @@ __gthread_objc_mutex_deallocate(objc_mutex_t mutex)
return 0; return 0;
} }
/* Grab a lock on a mutex. */ /* Grab a lock on a mutex. */
static inline int static inline int
__gthread_objc_mutex_lock(objc_mutex_t mutex) __gthread_objc_mutex_lock(objc_mutex_t mutex)
{ {
...@@ -324,7 +324,7 @@ __gthread_objc_mutex_lock(objc_mutex_t mutex) ...@@ -324,7 +324,7 @@ __gthread_objc_mutex_lock(objc_mutex_t mutex)
return 0; return 0;
} }
/* Try to grab a lock on a mutex. */ /* Try to grab a lock on a mutex. */
static inline int static inline int
__gthread_objc_mutex_trylock(objc_mutex_t mutex) __gthread_objc_mutex_trylock(objc_mutex_t mutex)
{ {
...@@ -347,23 +347,23 @@ __gthread_objc_mutex_unlock(objc_mutex_t mutex) ...@@ -347,23 +347,23 @@ __gthread_objc_mutex_unlock(objc_mutex_t mutex)
/* Backend condition mutex functions */ /* Backend condition mutex functions */
/* Allocate a condition. */ /* Allocate a condition. */
static inline int static inline int
__gthread_objc_condition_allocate(objc_condition_t condition) __gthread_objc_condition_allocate(objc_condition_t condition)
{ {
if (__gthread_active_p ()) if (__gthread_active_p ())
/* Unimplemented. */ /* Unimplemented. */
return -1; return -1;
else else
return 0; return 0;
} }
/* Deallocate a condition. */ /* Deallocate a condition. */
static inline int static inline int
__gthread_objc_condition_deallocate(objc_condition_t condition) __gthread_objc_condition_deallocate(objc_condition_t condition)
{ {
if (__gthread_active_p ()) if (__gthread_active_p ())
/* Unimplemented. */ /* Unimplemented. */
return -1; return -1;
else else
return 0; return 0;
...@@ -374,29 +374,29 @@ static inline int ...@@ -374,29 +374,29 @@ static inline int
__gthread_objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex) __gthread_objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
{ {
if (__gthread_active_p ()) if (__gthread_active_p ())
/* Unimplemented. */ /* Unimplemented. */
return -1; return -1;
else else
return 0; return 0;
} }
/* Wake up all threads waiting on this condition. */ /* Wake up all threads waiting on this condition. */
static inline int static inline int
__gthread_objc_condition_broadcast(objc_condition_t condition) __gthread_objc_condition_broadcast(objc_condition_t condition)
{ {
if (__gthread_active_p ()) if (__gthread_active_p ())
/* Unimplemented. */ /* Unimplemented. */
return -1; return -1;
else else
return 0; return 0;
} }
/* Wake up one thread waiting on this condition. */ /* Wake up one thread waiting on this condition. */
static inline int static inline int
__gthread_objc_condition_signal(objc_condition_t condition) __gthread_objc_condition_signal(objc_condition_t condition)
{ {
if (__gthread_active_p ()) if (__gthread_active_p ())
/* Unimplemented. */ /* Unimplemented. */
return -1; return -1;
else else
return 0; return 0;
...@@ -422,7 +422,7 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) ...@@ -422,7 +422,7 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
static inline int static inline int
__gthread_key_dtor (UNUSED (__gthread_key_t key), UNUSED (void *ptr)) __gthread_key_dtor (UNUSED (__gthread_key_t key), UNUSED (void *ptr))
{ {
/* Nothing needed. */ /* Nothing needed. */
return 0; return 0;
} }
......
...@@ -30,7 +30,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -30,7 +30,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define GCC_GTHR_POSIX_H #define GCC_GTHR_POSIX_H
/* POSIX threads specific definitions. /* POSIX threads specific definitions.
Easy, since the interface is just one-to-one mapping. */ Easy, since the interface is just one-to-one mapping. */
#define __GTHREADS 1 #define __GTHREADS 1
...@@ -57,7 +57,7 @@ typedef pthread_mutex_t __gthread_mutex_t; ...@@ -57,7 +57,7 @@ typedef pthread_mutex_t __gthread_mutex_t;
#pragma weak pthread_mutex_unlock #pragma weak pthread_mutex_unlock
#ifdef _LIBOBJC #ifdef _LIBOBJC
/* Objective C. */ /* Objective C. */
#pragma weak pthread_cond_broadcast #pragma weak pthread_cond_broadcast
#pragma weak pthread_cond_destroy #pragma weak pthread_cond_destroy
#pragma weak pthread_cond_init #pragma weak pthread_cond_init
...@@ -113,7 +113,7 @@ static void *thread_local_storage = NULL; ...@@ -113,7 +113,7 @@ static void *thread_local_storage = NULL;
/* Backend initialization functions */ /* Backend initialization functions */
/* Initialize the threads subsystem. */ /* Initialize the threads subsystem. */
static inline int static inline int
__gthread_objc_init_thread_system(void) __gthread_objc_init_thread_system(void)
{ {
...@@ -135,7 +135,7 @@ __gthread_objc_init_thread_system(void) ...@@ -135,7 +135,7 @@ __gthread_objc_init_thread_system(void)
return -1; return -1;
} }
/* Close the threads subsystem. */ /* Close the threads subsystem. */
static inline int static inline int
__gthread_objc_close_thread_system(void) __gthread_objc_close_thread_system(void)
{ {
...@@ -149,7 +149,7 @@ __gthread_objc_close_thread_system(void) ...@@ -149,7 +149,7 @@ __gthread_objc_close_thread_system(void)
/* Backend thread functions */ /* Backend thread functions */
/* Create a new thread of execution. */ /* Create a new thread of execution. */
static inline objc_thread_t static inline objc_thread_t
__gthread_objc_thread_detach(void (*func)(void *), void *arg) __gthread_objc_thread_detach(void (*func)(void *), void *arg)
{ {
...@@ -167,7 +167,7 @@ __gthread_objc_thread_detach(void (*func)(void *), void *arg) ...@@ -167,7 +167,7 @@ __gthread_objc_thread_detach(void (*func)(void *), void *arg)
return thread_id; return thread_id;
} }
/* Set the current thread's priority. */ /* Set the current thread's priority. */
static inline int static inline int
__gthread_objc_thread_set_priority(int priority) __gthread_objc_thread_set_priority(int priority)
{ {
...@@ -205,7 +205,7 @@ __gthread_objc_thread_set_priority(int priority) ...@@ -205,7 +205,7 @@ __gthread_objc_thread_set_priority(int priority)
} }
} }
/* Return the current thread's priority. */ /* Return the current thread's priority. */
static inline int static inline int
__gthread_objc_thread_get_priority(void) __gthread_objc_thread_get_priority(void)
{ {
...@@ -223,7 +223,7 @@ __gthread_objc_thread_get_priority(void) ...@@ -223,7 +223,7 @@ __gthread_objc_thread_get_priority(void)
return OBJC_THREAD_INTERACTIVE_PRIORITY; return OBJC_THREAD_INTERACTIVE_PRIORITY;
} }
/* Yield our process time to another thread. */ /* Yield our process time to another thread. */
static inline void static inline void
__gthread_objc_thread_yield(void) __gthread_objc_thread_yield(void)
{ {
...@@ -231,7 +231,7 @@ __gthread_objc_thread_yield(void) ...@@ -231,7 +231,7 @@ __gthread_objc_thread_yield(void)
sched_yield(); sched_yield();
} }
/* Terminate the current thread. */ /* Terminate the current thread. */
static inline int static inline int
__gthread_objc_thread_exit(void) __gthread_objc_thread_exit(void)
{ {
...@@ -243,7 +243,7 @@ __gthread_objc_thread_exit(void) ...@@ -243,7 +243,7 @@ __gthread_objc_thread_exit(void)
return -1; return -1;
} }
/* Returns an integer value which uniquely describes a thread. */ /* Returns an integer value which uniquely describes a thread. */
static inline objc_thread_t static inline objc_thread_t
__gthread_objc_thread_id(void) __gthread_objc_thread_id(void)
{ {
...@@ -253,7 +253,7 @@ __gthread_objc_thread_id(void) ...@@ -253,7 +253,7 @@ __gthread_objc_thread_id(void)
return (objc_thread_t) 1; return (objc_thread_t) 1;
} }
/* Sets the thread's local storage pointer. */ /* Sets the thread's local storage pointer. */
static inline int static inline int
__gthread_objc_thread_set_data(void *value) __gthread_objc_thread_set_data(void *value)
{ {
...@@ -266,7 +266,7 @@ __gthread_objc_thread_set_data(void *value) ...@@ -266,7 +266,7 @@ __gthread_objc_thread_set_data(void *value)
} }
} }
/* Returns the thread's local storage pointer. */ /* Returns the thread's local storage pointer. */
static inline void * static inline void *
__gthread_objc_thread_get_data(void) __gthread_objc_thread_get_data(void)
{ {
...@@ -278,7 +278,7 @@ __gthread_objc_thread_get_data(void) ...@@ -278,7 +278,7 @@ __gthread_objc_thread_get_data(void)
/* Backend mutex functions */ /* Backend mutex functions */
/* Allocate a mutex. */ /* Allocate a mutex. */
static inline int static inline int
__gthread_objc_mutex_allocate(objc_mutex_t mutex) __gthread_objc_mutex_allocate(objc_mutex_t mutex)
{ {
...@@ -297,7 +297,7 @@ __gthread_objc_mutex_allocate(objc_mutex_t mutex) ...@@ -297,7 +297,7 @@ __gthread_objc_mutex_allocate(objc_mutex_t mutex)
return 0; return 0;
} }
/* Deallocate a mutex. */ /* Deallocate a mutex. */
static inline int static inline int
__gthread_objc_mutex_deallocate(objc_mutex_t mutex) __gthread_objc_mutex_deallocate(objc_mutex_t mutex)
{ {
...@@ -327,7 +327,7 @@ __gthread_objc_mutex_deallocate(objc_mutex_t mutex) ...@@ -327,7 +327,7 @@ __gthread_objc_mutex_deallocate(objc_mutex_t mutex)
return 0; return 0;
} }
/* Grab a lock on a mutex. */ /* Grab a lock on a mutex. */
static inline int static inline int
__gthread_objc_mutex_lock(objc_mutex_t mutex) __gthread_objc_mutex_lock(objc_mutex_t mutex)
{ {
...@@ -340,7 +340,7 @@ __gthread_objc_mutex_lock(objc_mutex_t mutex) ...@@ -340,7 +340,7 @@ __gthread_objc_mutex_lock(objc_mutex_t mutex)
return 0; return 0;
} }
/* Try to grab a lock on a mutex. */ /* Try to grab a lock on a mutex. */
static inline int static inline int
__gthread_objc_mutex_trylock(objc_mutex_t mutex) __gthread_objc_mutex_trylock(objc_mutex_t mutex)
{ {
...@@ -368,7 +368,7 @@ __gthread_objc_mutex_unlock(objc_mutex_t mutex) ...@@ -368,7 +368,7 @@ __gthread_objc_mutex_unlock(objc_mutex_t mutex)
/* Backend condition mutex functions */ /* Backend condition mutex functions */
/* Allocate a condition. */ /* Allocate a condition. */
static inline int static inline int
__gthread_objc_condition_allocate(objc_condition_t condition) __gthread_objc_condition_allocate(objc_condition_t condition)
{ {
...@@ -387,7 +387,7 @@ __gthread_objc_condition_allocate(objc_condition_t condition) ...@@ -387,7 +387,7 @@ __gthread_objc_condition_allocate(objc_condition_t condition)
return 0; return 0;
} }
/* Deallocate a condition. */ /* Deallocate a condition. */
static inline int static inline int
__gthread_objc_condition_deallocate(objc_condition_t condition) __gthread_objc_condition_deallocate(objc_condition_t condition)
{ {
...@@ -413,7 +413,7 @@ __gthread_objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex) ...@@ -413,7 +413,7 @@ __gthread_objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
return 0; return 0;
} }
/* Wake up all threads waiting on this condition. */ /* Wake up all threads waiting on this condition. */
static inline int static inline int
__gthread_objc_condition_broadcast(objc_condition_t condition) __gthread_objc_condition_broadcast(objc_condition_t condition)
{ {
...@@ -423,7 +423,7 @@ __gthread_objc_condition_broadcast(objc_condition_t condition) ...@@ -423,7 +423,7 @@ __gthread_objc_condition_broadcast(objc_condition_t condition)
return 0; return 0;
} }
/* Wake up one thread waiting on this condition. */ /* Wake up one thread waiting on this condition. */
static inline int static inline int
__gthread_objc_condition_signal(objc_condition_t condition) __gthread_objc_condition_signal(objc_condition_t condition)
{ {
...@@ -453,7 +453,7 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) ...@@ -453,7 +453,7 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
static inline int static inline int
__gthread_key_dtor (__gthread_key_t key, void *ptr) __gthread_key_dtor (__gthread_key_t key, void *ptr)
{ {
/* Just reset the key value to zero. */ /* Just reset the key value to zero. */
if (ptr) if (ptr)
return pthread_setspecific (key, 0); return pthread_setspecific (key, 0);
else else
......
...@@ -29,7 +29,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -29,7 +29,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_GTHR_SINGLE_H #ifndef GCC_GTHR_SINGLE_H
#define GCC_GTHR_SINGLE_H #define GCC_GTHR_SINGLE_H
/* Just provide compatibility for mutex handling. */ /* Just provide compatibility for mutex handling. */
typedef int __gthread_mutex_t; typedef int __gthread_mutex_t;
...@@ -48,7 +48,7 @@ static void *thread_local_storage = NULL; ...@@ -48,7 +48,7 @@ static void *thread_local_storage = NULL;
/* Backend initialization functions */ /* Backend initialization functions */
/* Initialize the threads subsystem. */ /* Initialize the threads subsystem. */
static inline int static inline int
__gthread_objc_init_thread_system(void) __gthread_objc_init_thread_system(void)
{ {
...@@ -56,7 +56,7 @@ __gthread_objc_init_thread_system(void) ...@@ -56,7 +56,7 @@ __gthread_objc_init_thread_system(void)
return -1; return -1;
} }
/* Close the threads subsystem. */ /* Close the threads subsystem. */
static inline int static inline int
__gthread_objc_close_thread_system(void) __gthread_objc_close_thread_system(void)
{ {
...@@ -66,7 +66,7 @@ __gthread_objc_close_thread_system(void) ...@@ -66,7 +66,7 @@ __gthread_objc_close_thread_system(void)
/* Backend thread functions */ /* Backend thread functions */
/* Create a new thread of execution. */ /* Create a new thread of execution. */
static inline objc_thread_t static inline objc_thread_t
__gthread_objc_thread_detach(void (* func)(void *), void * UNUSED(arg)) __gthread_objc_thread_detach(void (* func)(void *), void * UNUSED(arg))
{ {
...@@ -74,7 +74,7 @@ __gthread_objc_thread_detach(void (* func)(void *), void * UNUSED(arg)) ...@@ -74,7 +74,7 @@ __gthread_objc_thread_detach(void (* func)(void *), void * UNUSED(arg))
return NULL; return NULL;
} }
/* Set the current thread's priority. */ /* Set the current thread's priority. */
static inline int static inline int
__gthread_objc_thread_set_priority(int UNUSED(priority)) __gthread_objc_thread_set_priority(int UNUSED(priority))
{ {
...@@ -82,21 +82,21 @@ __gthread_objc_thread_set_priority(int UNUSED(priority)) ...@@ -82,21 +82,21 @@ __gthread_objc_thread_set_priority(int UNUSED(priority))
return -1; return -1;
} }
/* Return the current thread's priority. */ /* Return the current thread's priority. */
static inline int static inline int
__gthread_objc_thread_get_priority(void) __gthread_objc_thread_get_priority(void)
{ {
return OBJC_THREAD_INTERACTIVE_PRIORITY; return OBJC_THREAD_INTERACTIVE_PRIORITY;
} }
/* Yield our process time to another thread. */ /* Yield our process time to another thread. */
static inline void static inline void
__gthread_objc_thread_yield(void) __gthread_objc_thread_yield(void)
{ {
return; return;
} }
/* Terminate the current thread. */ /* Terminate the current thread. */
static inline int static inline int
__gthread_objc_thread_exit(void) __gthread_objc_thread_exit(void)
{ {
...@@ -106,15 +106,15 @@ __gthread_objc_thread_exit(void) ...@@ -106,15 +106,15 @@ __gthread_objc_thread_exit(void)
return -1; return -1;
} }
/* Returns an integer value which uniquely describes a thread. */ /* Returns an integer value which uniquely describes a thread. */
static inline objc_thread_t static inline objc_thread_t
__gthread_objc_thread_id(void) __gthread_objc_thread_id(void)
{ {
/* No thread support, use 1. */ /* No thread support, use 1. */
return (objc_thread_t)1; return (objc_thread_t)1;
} }
/* Sets the thread's local storage pointer. */ /* Sets the thread's local storage pointer. */
static inline int static inline int
__gthread_objc_thread_set_data(void *value) __gthread_objc_thread_set_data(void *value)
{ {
...@@ -122,7 +122,7 @@ __gthread_objc_thread_set_data(void *value) ...@@ -122,7 +122,7 @@ __gthread_objc_thread_set_data(void *value)
return 0; return 0;
} }
/* Returns the thread's local storage pointer. */ /* Returns the thread's local storage pointer. */
static inline void * static inline void *
__gthread_objc_thread_get_data(void) __gthread_objc_thread_get_data(void)
{ {
...@@ -131,21 +131,21 @@ __gthread_objc_thread_get_data(void) ...@@ -131,21 +131,21 @@ __gthread_objc_thread_get_data(void)
/* Backend mutex functions */ /* Backend mutex functions */
/* Allocate a mutex. */ /* Allocate a mutex. */
static inline int static inline int
__gthread_objc_mutex_allocate(objc_mutex_t UNUSED(mutex)) __gthread_objc_mutex_allocate(objc_mutex_t UNUSED(mutex))
{ {
return 0; return 0;
} }
/* Deallocate a mutex. */ /* Deallocate a mutex. */
static inline int static inline int
__gthread_objc_mutex_deallocate(objc_mutex_t UNUSED(mutex)) __gthread_objc_mutex_deallocate(objc_mutex_t UNUSED(mutex))
{ {
return 0; return 0;
} }
/* Grab a lock on a mutex. */ /* Grab a lock on a mutex. */
static inline int static inline int
__gthread_objc_mutex_lock(objc_mutex_t UNUSED(mutex)) __gthread_objc_mutex_lock(objc_mutex_t UNUSED(mutex))
{ {
...@@ -153,7 +153,7 @@ __gthread_objc_mutex_lock(objc_mutex_t UNUSED(mutex)) ...@@ -153,7 +153,7 @@ __gthread_objc_mutex_lock(objc_mutex_t UNUSED(mutex))
return 0; return 0;
} }
/* Try to grab a lock on a mutex. */ /* Try to grab a lock on a mutex. */
static inline int static inline int
__gthread_objc_mutex_trylock(objc_mutex_t UNUSED(mutex)) __gthread_objc_mutex_trylock(objc_mutex_t UNUSED(mutex))
{ {
...@@ -170,14 +170,14 @@ __gthread_objc_mutex_unlock(objc_mutex_t UNUSED(mutex)) ...@@ -170,14 +170,14 @@ __gthread_objc_mutex_unlock(objc_mutex_t UNUSED(mutex))
/* Backend condition mutex functions */ /* Backend condition mutex functions */
/* Allocate a condition. */ /* Allocate a condition. */
static inline int static inline int
__gthread_objc_condition_allocate(objc_condition_t UNUSED(condition)) __gthread_objc_condition_allocate(objc_condition_t UNUSED(condition))
{ {
return 0; return 0;
} }
/* Deallocate a condition. */ /* Deallocate a condition. */
static inline int static inline int
__gthread_objc_condition_deallocate(objc_condition_t UNUSED(condition)) __gthread_objc_condition_deallocate(objc_condition_t UNUSED(condition))
{ {
...@@ -192,14 +192,14 @@ __gthread_objc_condition_wait(objc_condition_t UNUSED(condition), ...@@ -192,14 +192,14 @@ __gthread_objc_condition_wait(objc_condition_t UNUSED(condition),
return 0; return 0;
} }
/* Wake up all threads waiting on this condition. */ /* Wake up all threads waiting on this condition. */
static inline int static inline int
__gthread_objc_condition_broadcast(objc_condition_t UNUSED(condition)) __gthread_objc_condition_broadcast(objc_condition_t UNUSED(condition))
{ {
return 0; return 0;
} }
/* Wake up one thread waiting on this condition. */ /* Wake up one thread waiting on this condition. */
static inline int static inline int
__gthread_objc_condition_signal(objc_condition_t UNUSED(condition)) __gthread_objc_condition_signal(objc_condition_t UNUSED(condition))
{ {
......
...@@ -31,7 +31,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -31,7 +31,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Solaris threads as found in Solaris 2.[456]. /* Solaris threads as found in Solaris 2.[456].
Actually these are Unix International (UI) threads, but I don't Actually these are Unix International (UI) threads, but I don't
know if anyone else implements these. */ know if anyone else implements these. */
#define __GTHREADS 1 #define __GTHREADS 1
...@@ -79,7 +79,7 @@ typedef mutex_t __gthread_mutex_t; ...@@ -79,7 +79,7 @@ typedef mutex_t __gthread_mutex_t;
#endif #endif
/* This will not actually work in Solaris 2.5, since libc contains /* This will not actually work in Solaris 2.5, since libc contains
dummy symbols of all thr_* routines. */ dummy symbols of all thr_* routines. */
static void *__gthread_active_ptr = (void *) &thr_create; static void *__gthread_active_ptr = (void *) &thr_create;
...@@ -109,7 +109,7 @@ static void *thread_local_storage = NULL; ...@@ -109,7 +109,7 @@ static void *thread_local_storage = NULL;
/* Backend initialization functions */ /* Backend initialization functions */
/* Initialize the threads subsystem. */ /* Initialize the threads subsystem. */
static inline int static inline int
__gthread_objc_init_thread_system(void) __gthread_objc_init_thread_system(void)
{ {
...@@ -121,7 +121,7 @@ __gthread_objc_init_thread_system(void) ...@@ -121,7 +121,7 @@ __gthread_objc_init_thread_system(void)
return -1; return -1;
} }
/* Close the threads subsystem. */ /* Close the threads subsystem. */
static inline int static inline int
__gthread_objc_close_thread_system(void) __gthread_objc_close_thread_system(void)
{ {
...@@ -133,7 +133,7 @@ __gthread_objc_close_thread_system(void) ...@@ -133,7 +133,7 @@ __gthread_objc_close_thread_system(void)
/* Backend thread functions */ /* Backend thread functions */
/* Create a new thread of execution. */ /* Create a new thread of execution. */
static inline objc_thread_t static inline objc_thread_t
__gthread_objc_thread_detach(void (*func)(void *), void *arg) __gthread_objc_thread_detach(void (*func)(void *), void *arg)
{ {
...@@ -153,7 +153,7 @@ __gthread_objc_thread_detach(void (*func)(void *), void *arg) ...@@ -153,7 +153,7 @@ __gthread_objc_thread_detach(void (*func)(void *), void *arg)
return thread_id; return thread_id;
} }
/* Set the current thread's priority. */ /* Set the current thread's priority. */
static inline int static inline int
__gthread_objc_thread_set_priority(int priority) __gthread_objc_thread_set_priority(int priority)
{ {
...@@ -183,7 +183,7 @@ __gthread_objc_thread_set_priority(int priority) ...@@ -183,7 +183,7 @@ __gthread_objc_thread_set_priority(int priority)
return -1; return -1;
} }
/* Return the current thread's priority. */ /* Return the current thread's priority. */
static inline int static inline int
__gthread_objc_thread_get_priority(void) __gthread_objc_thread_get_priority(void)
{ {
...@@ -201,11 +201,11 @@ __gthread_objc_thread_get_priority(void) ...@@ -201,11 +201,11 @@ __gthread_objc_thread_get_priority(void)
return OBJC_THREAD_LOW_PRIORITY; return OBJC_THREAD_LOW_PRIORITY;
} }
/* Couldn't get priority. */ /* Couldn't get priority. */
return -1; return -1;
} }
/* Yield our process time to another thread. */ /* Yield our process time to another thread. */
static inline void static inline void
__gthread_objc_thread_yield(void) __gthread_objc_thread_yield(void)
{ {
...@@ -213,7 +213,7 @@ __gthread_objc_thread_yield(void) ...@@ -213,7 +213,7 @@ __gthread_objc_thread_yield(void)
thr_yield(); thr_yield();
} }
/* Terminate the current thread. */ /* Terminate the current thread. */
static inline int static inline int
__gthread_objc_thread_exit(void) __gthread_objc_thread_exit(void)
{ {
...@@ -225,7 +225,7 @@ __gthread_objc_thread_exit(void) ...@@ -225,7 +225,7 @@ __gthread_objc_thread_exit(void)
return -1; return -1;
} }
/* Returns an integer value which uniquely describes a thread. */ /* Returns an integer value which uniquely describes a thread. */
static inline objc_thread_t static inline objc_thread_t
__gthread_objc_thread_id(void) __gthread_objc_thread_id(void)
{ {
...@@ -235,7 +235,7 @@ __gthread_objc_thread_id(void) ...@@ -235,7 +235,7 @@ __gthread_objc_thread_id(void)
return (objc_thread_t)1; return (objc_thread_t)1;
} }
/* Sets the thread's local storage pointer. */ /* Sets the thread's local storage pointer. */
static inline int static inline int
__gthread_objc_thread_set_data(void *value) __gthread_objc_thread_set_data(void *value)
{ {
...@@ -253,7 +253,7 @@ __gthread_objc_thread_set_data(void *value) ...@@ -253,7 +253,7 @@ __gthread_objc_thread_set_data(void *value)
} }
} }
/* Returns the thread's local storage pointer. */ /* Returns the thread's local storage pointer. */
static inline void * static inline void *
__gthread_objc_thread_get_data(void) __gthread_objc_thread_get_data(void)
{ {
...@@ -272,7 +272,7 @@ __gthread_objc_thread_get_data(void) ...@@ -272,7 +272,7 @@ __gthread_objc_thread_get_data(void)
/* Backend mutex functions */ /* Backend mutex functions */
/* Allocate a mutex. */ /* Allocate a mutex. */
static inline int static inline int
__gthread_objc_mutex_allocate(objc_mutex_t mutex) __gthread_objc_mutex_allocate(objc_mutex_t mutex)
{ {
...@@ -283,7 +283,7 @@ __gthread_objc_mutex_allocate(objc_mutex_t mutex) ...@@ -283,7 +283,7 @@ __gthread_objc_mutex_allocate(objc_mutex_t mutex)
return 0; return 0;
} }
/* Deallocate a mutex. */ /* Deallocate a mutex. */
static inline int static inline int
__gthread_objc_mutex_deallocate(objc_mutex_t mutex) __gthread_objc_mutex_deallocate(objc_mutex_t mutex)
{ {
...@@ -293,7 +293,7 @@ __gthread_objc_mutex_deallocate(objc_mutex_t mutex) ...@@ -293,7 +293,7 @@ __gthread_objc_mutex_deallocate(objc_mutex_t mutex)
return 0; return 0;
} }
/* Grab a lock on a mutex. */ /* Grab a lock on a mutex. */
static inline int static inline int
__gthread_objc_mutex_lock(objc_mutex_t mutex) __gthread_objc_mutex_lock(objc_mutex_t mutex)
{ {
...@@ -304,7 +304,7 @@ __gthread_objc_mutex_lock(objc_mutex_t mutex) ...@@ -304,7 +304,7 @@ __gthread_objc_mutex_lock(objc_mutex_t mutex)
return 0; return 0;
} }
/* Try to grab a lock on a mutex. */ /* Try to grab a lock on a mutex. */
static inline int static inline int
__gthread_objc_mutex_trylock(objc_mutex_t mutex) __gthread_objc_mutex_trylock(objc_mutex_t mutex)
{ {
...@@ -328,7 +328,7 @@ __gthread_objc_mutex_unlock(objc_mutex_t mutex) ...@@ -328,7 +328,7 @@ __gthread_objc_mutex_unlock(objc_mutex_t mutex)
/* Backend condition mutex functions */ /* Backend condition mutex functions */
/* Allocate a condition. */ /* Allocate a condition. */
static inline int static inline int
__gthread_objc_condition_allocate(objc_condition_t condition) __gthread_objc_condition_allocate(objc_condition_t condition)
{ {
...@@ -339,7 +339,7 @@ __gthread_objc_condition_allocate(objc_condition_t condition) ...@@ -339,7 +339,7 @@ __gthread_objc_condition_allocate(objc_condition_t condition)
return 0; return 0;
} }
/* Deallocate a condition. */ /* Deallocate a condition. */
static inline int static inline int
__gthread_objc_condition_deallocate(objc_condition_t condition) __gthread_objc_condition_deallocate(objc_condition_t condition)
{ {
...@@ -360,7 +360,7 @@ __gthread_objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex) ...@@ -360,7 +360,7 @@ __gthread_objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
return 0; return 0;
} }
/* Wake up all threads waiting on this condition. */ /* Wake up all threads waiting on this condition. */
static inline int static inline int
__gthread_objc_condition_broadcast(objc_condition_t condition) __gthread_objc_condition_broadcast(objc_condition_t condition)
{ {
...@@ -370,7 +370,7 @@ __gthread_objc_condition_broadcast(objc_condition_t condition) ...@@ -370,7 +370,7 @@ __gthread_objc_condition_broadcast(objc_condition_t condition)
return 0; return 0;
} }
/* Wake up one thread waiting on this condition. */ /* Wake up one thread waiting on this condition. */
static inline int static inline int
__gthread_objc_condition_signal(objc_condition_t condition) __gthread_objc_condition_signal(objc_condition_t condition)
{ {
...@@ -410,7 +410,7 @@ static inline int ...@@ -410,7 +410,7 @@ static inline int
__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
{ {
/* Solaris 2.5 contains thr_* routines no-op in libc, so test if we actually /* Solaris 2.5 contains thr_* routines no-op in libc, so test if we actually
got a reasonable key value, and if not, fail. */ got a reasonable key value, and if not, fail. */
*key = -1; *key = -1;
if (thr_keycreate (key, dtor) != 0 || *key == -1) if (thr_keycreate (key, dtor) != 0 || *key == -1)
return -1; return -1;
...@@ -421,14 +421,14 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) ...@@ -421,14 +421,14 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
static inline int static inline int
__gthread_key_dtor (__gthread_key_t key, void *ptr) __gthread_key_dtor (__gthread_key_t key, void *ptr)
{ {
/* Nothing needed. */ /* Nothing needed. */
return 0; return 0;
} }
static inline int static inline int
__gthread_key_delete (__gthread_key_t key) __gthread_key_delete (__gthread_key_t key)
{ {
/* Not possible. */ /* Not possible. */
return -1; return -1;
} }
......
...@@ -37,7 +37,7 @@ static void *thread_local_storage = NULL; ...@@ -37,7 +37,7 @@ static void *thread_local_storage = NULL;
/* Backend initialization functions */ /* Backend initialization functions */
/* Initialize the threads subsystem. */ /* Initialize the threads subsystem. */
int int
__gthread_objc_init_thread_system(void) __gthread_objc_init_thread_system(void)
{ {
...@@ -45,7 +45,7 @@ __gthread_objc_init_thread_system(void) ...@@ -45,7 +45,7 @@ __gthread_objc_init_thread_system(void)
return -1; return -1;
} }
/* Close the threads subsystem. */ /* Close the threads subsystem. */
int int
__gthread_objc_close_thread_system(void) __gthread_objc_close_thread_system(void)
{ {
...@@ -55,7 +55,7 @@ __gthread_objc_close_thread_system(void) ...@@ -55,7 +55,7 @@ __gthread_objc_close_thread_system(void)
/* Backend thread functions */ /* Backend thread functions */
/* Create a new thread of execution. */ /* Create a new thread of execution. */
objc_thread_t objc_thread_t
__gthread_objc_thread_detach(void (*func)(void *arg), void *arg) __gthread_objc_thread_detach(void (*func)(void *arg), void *arg)
{ {
...@@ -63,7 +63,7 @@ __gthread_objc_thread_detach(void (*func)(void *arg), void *arg) ...@@ -63,7 +63,7 @@ __gthread_objc_thread_detach(void (*func)(void *arg), void *arg)
return NULL; return NULL;
} }
/* Set the current thread's priority. */ /* Set the current thread's priority. */
int int
__gthread_objc_thread_set_priority(int priority) __gthread_objc_thread_set_priority(int priority)
{ {
...@@ -71,21 +71,21 @@ __gthread_objc_thread_set_priority(int priority) ...@@ -71,21 +71,21 @@ __gthread_objc_thread_set_priority(int priority)
return -1; return -1;
} }
/* Return the current thread's priority. */ /* Return the current thread's priority. */
int int
__gthread_objc_thread_get_priority(void) __gthread_objc_thread_get_priority(void)
{ {
return OBJC_THREAD_INTERACTIVE_PRIORITY; return OBJC_THREAD_INTERACTIVE_PRIORITY;
} }
/* Yield our process time to another thread. */ /* Yield our process time to another thread. */
void void
__gthread_objc_thread_yield(void) __gthread_objc_thread_yield(void)
{ {
return; return;
} }
/* Terminate the current thread. */ /* Terminate the current thread. */
int int
__gthread_objc_thread_exit(void) __gthread_objc_thread_exit(void)
{ {
...@@ -95,15 +95,15 @@ __gthread_objc_thread_exit(void) ...@@ -95,15 +95,15 @@ __gthread_objc_thread_exit(void)
return -1; return -1;
} }
/* Returns an integer value which uniquely describes a thread. */ /* Returns an integer value which uniquely describes a thread. */
objc_thread_t objc_thread_t
__gthread_objc_thread_id(void) __gthread_objc_thread_id(void)
{ {
/* No thread support, use 1. */ /* No thread support, use 1. */
return (objc_thread_t)1; return (objc_thread_t)1;
} }
/* Sets the thread's local storage pointer. */ /* Sets the thread's local storage pointer. */
int int
__gthread_objc_thread_set_data(void *value) __gthread_objc_thread_set_data(void *value)
{ {
...@@ -111,7 +111,7 @@ __gthread_objc_thread_set_data(void *value) ...@@ -111,7 +111,7 @@ __gthread_objc_thread_set_data(void *value)
return 0; return 0;
} }
/* Returns the thread's local storage pointer. */ /* Returns the thread's local storage pointer. */
void * void *
__gthread_objc_thread_get_data(void) __gthread_objc_thread_get_data(void)
{ {
...@@ -120,21 +120,21 @@ __gthread_objc_thread_get_data(void) ...@@ -120,21 +120,21 @@ __gthread_objc_thread_get_data(void)
/* Backend mutex functions */ /* Backend mutex functions */
/* Allocate a mutex. */ /* Allocate a mutex. */
int int
__gthread_objc_mutex_allocate(objc_mutex_t mutex) __gthread_objc_mutex_allocate(objc_mutex_t mutex)
{ {
return 0; return 0;
} }
/* Deallocate a mutex. */ /* Deallocate a mutex. */
int int
__gthread_objc_mutex_deallocate(objc_mutex_t mutex) __gthread_objc_mutex_deallocate(objc_mutex_t mutex)
{ {
return 0; return 0;
} }
/* Grab a lock on a mutex. */ /* Grab a lock on a mutex. */
int int
__gthread_objc_mutex_lock(objc_mutex_t mutex) __gthread_objc_mutex_lock(objc_mutex_t mutex)
{ {
...@@ -142,7 +142,7 @@ __gthread_objc_mutex_lock(objc_mutex_t mutex) ...@@ -142,7 +142,7 @@ __gthread_objc_mutex_lock(objc_mutex_t mutex)
return 0; return 0;
} }
/* Try to grab a lock on a mutex. */ /* Try to grab a lock on a mutex. */
int int
__gthread_objc_mutex_trylock(objc_mutex_t mutex) __gthread_objc_mutex_trylock(objc_mutex_t mutex)
{ {
...@@ -159,14 +159,14 @@ __gthread_objc_mutex_unlock(objc_mutex_t mutex) ...@@ -159,14 +159,14 @@ __gthread_objc_mutex_unlock(objc_mutex_t mutex)
/* Backend condition mutex functions */ /* Backend condition mutex functions */
/* Allocate a condition. */ /* Allocate a condition. */
int int
__gthread_objc_condition_allocate(objc_condition_t condition) __gthread_objc_condition_allocate(objc_condition_t condition)
{ {
return 0; return 0;
} }
/* Deallocate a condition. */ /* Deallocate a condition. */
int int
__gthread_objc_condition_deallocate(objc_condition_t condition) __gthread_objc_condition_deallocate(objc_condition_t condition)
{ {
...@@ -180,14 +180,14 @@ __gthread_objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex) ...@@ -180,14 +180,14 @@ __gthread_objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
return 0; return 0;
} }
/* Wake up all threads waiting on this condition. */ /* Wake up all threads waiting on this condition. */
int int
__gthread_objc_condition_broadcast(objc_condition_t condition) __gthread_objc_condition_broadcast(objc_condition_t condition)
{ {
return 0; return 0;
} }
/* Wake up one thread waiting on this condition. */ /* Wake up one thread waiting on this condition. */
int int
__gthread_objc_condition_signal(objc_condition_t condition) __gthread_objc_condition_signal(objc_condition_t condition)
{ {
...@@ -197,7 +197,7 @@ __gthread_objc_condition_signal(objc_condition_t condition) ...@@ -197,7 +197,7 @@ __gthread_objc_condition_signal(objc_condition_t condition)
#else /* _LIBOBJC */ #else /* _LIBOBJC */
/* POSIX threads specific definitions. /* POSIX threads specific definitions.
Easy, since the interface is just one-to-one mapping. */ Easy, since the interface is just one-to-one mapping. */
#define __GTHREADS 1 #define __GTHREADS 1
...@@ -264,7 +264,7 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) ...@@ -264,7 +264,7 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
static inline int static inline int
__gthread_key_dtor (__gthread_key_t key, void *ptr) __gthread_key_dtor (__gthread_key_t key, void *ptr)
{ {
/* Just reset the key value to zero. */ /* Just reset the key value to zero. */
if (ptr) if (ptr)
return __gthread_setspecific (key, 0); return __gthread_setspecific (key, 0);
else else
......
...@@ -77,7 +77,7 @@ static DWORD __gthread_objc_data_tls = (DWORD)-1; ...@@ -77,7 +77,7 @@ static DWORD __gthread_objc_data_tls = (DWORD)-1;
/* Backend initialization functions */ /* Backend initialization functions */
/* Initialize the threads subsystem. */ /* Initialize the threads subsystem. */
int int
__gthread_objc_init_thread_system(void) __gthread_objc_init_thread_system(void)
{ {
...@@ -88,7 +88,7 @@ __gthread_objc_init_thread_system(void) ...@@ -88,7 +88,7 @@ __gthread_objc_init_thread_system(void)
return -1; return -1;
} }
/* Close the threads subsystem. */ /* Close the threads subsystem. */
int int
__gthread_objc_close_thread_system(void) __gthread_objc_close_thread_system(void)
{ {
...@@ -99,7 +99,7 @@ __gthread_objc_close_thread_system(void) ...@@ -99,7 +99,7 @@ __gthread_objc_close_thread_system(void)
/* Backend thread functions */ /* Backend thread functions */
/* Create a new thread of execution. */ /* Create a new thread of execution. */
objc_thread_t objc_thread_t
__gthread_objc_thread_detach(void (*func)(void *arg), void *arg) __gthread_objc_thread_detach(void (*func)(void *arg), void *arg)
{ {
...@@ -113,7 +113,7 @@ __gthread_objc_thread_detach(void (*func)(void *arg), void *arg) ...@@ -113,7 +113,7 @@ __gthread_objc_thread_detach(void (*func)(void *arg), void *arg)
return (objc_thread_t)thread_id; return (objc_thread_t)thread_id;
} }
/* Set the current thread's priority. */ /* Set the current thread's priority. */
int int
__gthread_objc_thread_set_priority(int priority) __gthread_objc_thread_set_priority(int priority)
{ {
...@@ -140,7 +140,7 @@ __gthread_objc_thread_set_priority(int priority) ...@@ -140,7 +140,7 @@ __gthread_objc_thread_set_priority(int priority)
return -1; return -1;
} }
/* Return the current thread's priority. */ /* Return the current thread's priority. */
int int
__gthread_objc_thread_get_priority(void) __gthread_objc_thread_get_priority(void)
{ {
...@@ -165,18 +165,18 @@ __gthread_objc_thread_get_priority(void) ...@@ -165,18 +165,18 @@ __gthread_objc_thread_get_priority(void)
return OBJC_THREAD_LOW_PRIORITY; return OBJC_THREAD_LOW_PRIORITY;
} }
/* Couldn't get priority. */ /* Couldn't get priority. */
return -1; return -1;
} }
/* Yield our process time to another thread. */ /* Yield our process time to another thread. */
void void
__gthread_objc_thread_yield(void) __gthread_objc_thread_yield(void)
{ {
Sleep(0); Sleep(0);
} }
/* Terminate the current thread. */ /* Terminate the current thread. */
int int
__gthread_objc_thread_exit(void) __gthread_objc_thread_exit(void)
{ {
...@@ -187,14 +187,14 @@ __gthread_objc_thread_exit(void) ...@@ -187,14 +187,14 @@ __gthread_objc_thread_exit(void)
return -1; return -1;
} }
/* Returns an integer value which uniquely describes a thread. */ /* Returns an integer value which uniquely describes a thread. */
objc_thread_t objc_thread_t
__gthread_objc_thread_id(void) __gthread_objc_thread_id(void)
{ {
return (objc_thread_t)GetCurrentThreadId(); return (objc_thread_t)GetCurrentThreadId();
} }
/* Sets the thread's local storage pointer. */ /* Sets the thread's local storage pointer. */
int int
__gthread_objc_thread_set_data(void *value) __gthread_objc_thread_set_data(void *value)
{ {
...@@ -204,7 +204,7 @@ __gthread_objc_thread_set_data(void *value) ...@@ -204,7 +204,7 @@ __gthread_objc_thread_set_data(void *value)
return -1; return -1;
} }
/* Returns the thread's local storage pointer. */ /* Returns the thread's local storage pointer. */
void * void *
__gthread_objc_thread_get_data(void) __gthread_objc_thread_get_data(void)
{ {
...@@ -222,7 +222,7 @@ __gthread_objc_thread_get_data(void) ...@@ -222,7 +222,7 @@ __gthread_objc_thread_get_data(void)
/* Backend mutex functions */ /* Backend mutex functions */
/* Allocate a mutex. */ /* Allocate a mutex. */
int int
__gthread_objc_mutex_allocate(objc_mutex_t mutex) __gthread_objc_mutex_allocate(objc_mutex_t mutex)
{ {
...@@ -232,7 +232,7 @@ __gthread_objc_mutex_allocate(objc_mutex_t mutex) ...@@ -232,7 +232,7 @@ __gthread_objc_mutex_allocate(objc_mutex_t mutex)
return 0; return 0;
} }
/* Deallocate a mutex. */ /* Deallocate a mutex. */
int int
__gthread_objc_mutex_deallocate(objc_mutex_t mutex) __gthread_objc_mutex_deallocate(objc_mutex_t mutex)
{ {
...@@ -240,7 +240,7 @@ __gthread_objc_mutex_deallocate(objc_mutex_t mutex) ...@@ -240,7 +240,7 @@ __gthread_objc_mutex_deallocate(objc_mutex_t mutex)
return 0; return 0;
} }
/* Grab a lock on a mutex. */ /* Grab a lock on a mutex. */
int int
__gthread_objc_mutex_lock(objc_mutex_t mutex) __gthread_objc_mutex_lock(objc_mutex_t mutex)
{ {
...@@ -253,7 +253,7 @@ __gthread_objc_mutex_lock(objc_mutex_t mutex) ...@@ -253,7 +253,7 @@ __gthread_objc_mutex_lock(objc_mutex_t mutex)
return 0; return 0;
} }
/* Try to grab a lock on a mutex. */ /* Try to grab a lock on a mutex. */
int int
__gthread_objc_mutex_trylock(objc_mutex_t mutex) __gthread_objc_mutex_trylock(objc_mutex_t mutex)
{ {
...@@ -278,19 +278,19 @@ __gthread_objc_mutex_unlock(objc_mutex_t mutex) ...@@ -278,19 +278,19 @@ __gthread_objc_mutex_unlock(objc_mutex_t mutex)
/* Backend condition mutex functions */ /* Backend condition mutex functions */
/* Allocate a condition. */ /* Allocate a condition. */
int int
__gthread_objc_condition_allocate(objc_condition_t condition) __gthread_objc_condition_allocate(objc_condition_t condition)
{ {
/* Unimplemented. */ /* Unimplemented. */
return -1; return -1;
} }
/* Deallocate a condition. */ /* Deallocate a condition. */
int int
__gthread_objc_condition_deallocate(objc_condition_t condition) __gthread_objc_condition_deallocate(objc_condition_t condition)
{ {
/* Unimplemented. */ /* Unimplemented. */
return -1; return -1;
} }
...@@ -298,23 +298,23 @@ __gthread_objc_condition_deallocate(objc_condition_t condition) ...@@ -298,23 +298,23 @@ __gthread_objc_condition_deallocate(objc_condition_t condition)
int int
__gthread_objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex) __gthread_objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
{ {
/* Unimplemented. */ /* Unimplemented. */
return -1; return -1;
} }
/* Wake up all threads waiting on this condition. */ /* Wake up all threads waiting on this condition. */
int int
__gthread_objc_condition_broadcast(objc_condition_t condition) __gthread_objc_condition_broadcast(objc_condition_t condition)
{ {
/* Unimplemented. */ /* Unimplemented. */
return -1; return -1;
} }
/* Wake up one thread waiting on this condition. */ /* Wake up one thread waiting on this condition. */
int int
__gthread_objc_condition_signal(objc_condition_t condition) __gthread_objc_condition_signal(objc_condition_t condition)
{ {
/* Unimplemented. */ /* Unimplemented. */
return -1; return -1;
} }
...@@ -413,7 +413,7 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) ...@@ -413,7 +413,7 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
static inline int static inline int
__gthread_key_dtor (__gthread_key_t key, void *ptr) __gthread_key_dtor (__gthread_key_t key, void *ptr)
{ {
/* Nothing needed. */ /* Nothing needed. */
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment