+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>
* final.c (output_asm_insn): Make sure assembly dialects are
/* DCE threads interface.
DCE threads are based on POSIX threads draft 4, and many things
- have changed since then. */
+ have changed since then. */
#define __GTHREADS 1
#pragma weak pthread_mutex_unlock
#ifdef _LIBOBJC
-/* Objective C. */
+/* Objective C. */
#pragma weak pthread_cond_broadcast
#pragma weak pthread_cond_destroy
#pragma weak pthread_cond_init
/* Backend initialization functions */
-/* Initialize the threads subsystem. */
+/* Initialize the threads subsystem. */
static inline int
__gthread_objc_init_thread_system(void)
{
return -1;
}
-/* Close the threads subsystem. */
+/* Close the threads subsystem. */
static inline int
__gthread_objc_close_thread_system(void)
{
/* Backend thread functions */
-/* Create a new thread of execution. */
+/* Create a new thread of execution. */
static inline objc_thread_t
__gthread_objc_thread_detach(void (*func)(void *), void *arg)
{
{
/* ??? May not work! (64bit) */
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
thread_id = NULL;
return thread_id;
}
-/* Set the current thread's priority. */
+/* Set the current thread's priority. */
static inline int
__gthread_objc_thread_set_priority(int priority)
{
break;
}
- /* Change the priority. */
+ /* Change the priority. */
if (pthread_setprio(pthread_self(), sys_priority) >= 0)
return 0;
else
return -1;
}
-/* Return the current thread's priority. */
+/* Return the current thread's priority. */
static inline int
__gthread_objc_thread_get_priority(void)
{
return OBJC_THREAD_INTERACTIVE_PRIORITY;
}
-/* Yield our process time to another thread. */
+/* Yield our process time to another thread. */
static inline void
__gthread_objc_thread_yield(void)
{
pthread_yield();
}
-/* Terminate the current thread. */
+/* Terminate the current thread. */
static inline int
__gthread_objc_thread_exit(void)
{
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
__gthread_objc_thread_id(void)
{
return (objc_thread_t)1;
}
-/* Sets the thread's local storage pointer. */
+/* Sets the thread's local storage pointer. */
static inline int
__gthread_objc_thread_set_data(void *value)
{
}
}
-/* Returns the thread's local storage pointer. */
+/* Returns the thread's local storage pointer. */
static inline void *
__gthread_objc_thread_get_data(void)
{
/* Backend mutex functions */
-/* Allocate a mutex. */
+/* Allocate a mutex. */
static inline int
__gthread_objc_mutex_allocate(objc_mutex_t mutex)
{
return 0;
}
-/* Deallocate a mutex. */
+/* Deallocate a mutex. */
static inline int
__gthread_objc_mutex_deallocate(objc_mutex_t mutex)
{
return 0;
}
-/* Grab a lock on a mutex. */
+/* Grab a lock on a mutex. */
static inline int
__gthread_objc_mutex_lock(objc_mutex_t mutex)
{
return 0;
}
-/* Try to grab a lock on a mutex. */
+/* Try to grab a lock on a mutex. */
static inline int
__gthread_objc_mutex_trylock(objc_mutex_t mutex)
{
/* Backend condition mutex functions */
-/* Allocate a condition. */
+/* Allocate a condition. */
static inline int
__gthread_objc_condition_allocate(objc_condition_t condition)
{
if (__gthread_active_p ())
- /* Unimplemented. */
+ /* Unimplemented. */
return -1;
else
return 0;
}
-/* Deallocate a condition. */
+/* Deallocate a condition. */
static inline int
__gthread_objc_condition_deallocate(objc_condition_t condition)
{
if (__gthread_active_p ())
- /* Unimplemented. */
+ /* Unimplemented. */
return -1;
else
return 0;
__gthread_objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
{
if (__gthread_active_p ())
- /* Unimplemented. */
+ /* Unimplemented. */
return -1;
else
return 0;
}
-/* Wake up all threads waiting on this condition. */
+/* Wake up all threads waiting on this condition. */
static inline int
__gthread_objc_condition_broadcast(objc_condition_t condition)
{
if (__gthread_active_p ())
- /* Unimplemented. */
+ /* Unimplemented. */
return -1;
else
return 0;
}
-/* Wake up one thread waiting on this condition. */
+/* Wake up one thread waiting on this condition. */
static inline int
__gthread_objc_condition_signal(objc_condition_t condition)
{
if (__gthread_active_p ())
- /* Unimplemented. */
+ /* Unimplemented. */
return -1;
else
return 0;
static inline int
__gthread_key_dtor (UNUSED (__gthread_key_t key), UNUSED (void *ptr))
{
- /* Nothing needed. */
+ /* Nothing needed. */
return 0;
}
#define GCC_GTHR_POSIX_H
/* 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
#pragma weak pthread_mutex_unlock
#ifdef _LIBOBJC
-/* Objective C. */
+/* Objective C. */
#pragma weak pthread_cond_broadcast
#pragma weak pthread_cond_destroy
#pragma weak pthread_cond_init
/* Backend initialization functions */
-/* Initialize the threads subsystem. */
+/* Initialize the threads subsystem. */
static inline int
__gthread_objc_init_thread_system(void)
{
return -1;
}
-/* Close the threads subsystem. */
+/* Close the threads subsystem. */
static inline int
__gthread_objc_close_thread_system(void)
{
/* Backend thread functions */
-/* Create a new thread of execution. */
+/* Create a new thread of execution. */
static inline objc_thread_t
__gthread_objc_thread_detach(void (*func)(void *), void *arg)
{
return thread_id;
}
-/* Set the current thread's priority. */
+/* Set the current thread's priority. */
static inline int
__gthread_objc_thread_set_priority(int priority)
{
}
}
-/* Return the current thread's priority. */
+/* Return the current thread's priority. */
static inline int
__gthread_objc_thread_get_priority(void)
{
return OBJC_THREAD_INTERACTIVE_PRIORITY;
}
-/* Yield our process time to another thread. */
+/* Yield our process time to another thread. */
static inline void
__gthread_objc_thread_yield(void)
{
sched_yield();
}
-/* Terminate the current thread. */
+/* Terminate the current thread. */
static inline int
__gthread_objc_thread_exit(void)
{
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
__gthread_objc_thread_id(void)
{
return (objc_thread_t) 1;
}
-/* Sets the thread's local storage pointer. */
+/* Sets the thread's local storage pointer. */
static inline int
__gthread_objc_thread_set_data(void *value)
{
}
}
-/* Returns the thread's local storage pointer. */
+/* Returns the thread's local storage pointer. */
static inline void *
__gthread_objc_thread_get_data(void)
{
/* Backend mutex functions */
-/* Allocate a mutex. */
+/* Allocate a mutex. */
static inline int
__gthread_objc_mutex_allocate(objc_mutex_t mutex)
{
return 0;
}
-/* Deallocate a mutex. */
+/* Deallocate a mutex. */
static inline int
__gthread_objc_mutex_deallocate(objc_mutex_t mutex)
{
return 0;
}
-/* Grab a lock on a mutex. */
+/* Grab a lock on a mutex. */
static inline int
__gthread_objc_mutex_lock(objc_mutex_t mutex)
{
return 0;
}
-/* Try to grab a lock on a mutex. */
+/* Try to grab a lock on a mutex. */
static inline int
__gthread_objc_mutex_trylock(objc_mutex_t mutex)
{
/* Backend condition mutex functions */
-/* Allocate a condition. */
+/* Allocate a condition. */
static inline int
__gthread_objc_condition_allocate(objc_condition_t condition)
{
return 0;
}
-/* Deallocate a condition. */
+/* Deallocate a condition. */
static inline int
__gthread_objc_condition_deallocate(objc_condition_t condition)
{
return 0;
}
-/* Wake up all threads waiting on this condition. */
+/* Wake up all threads waiting on this condition. */
static inline int
__gthread_objc_condition_broadcast(objc_condition_t condition)
{
return 0;
}
-/* Wake up one thread waiting on this condition. */
+/* Wake up one thread waiting on this condition. */
static inline int
__gthread_objc_condition_signal(objc_condition_t condition)
{
static inline int
__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)
return pthread_setspecific (key, 0);
else
#ifndef 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;
/* Backend initialization functions */
-/* Initialize the threads subsystem. */
+/* Initialize the threads subsystem. */
static inline int
__gthread_objc_init_thread_system(void)
{
return -1;
}
-/* Close the threads subsystem. */
+/* Close the threads subsystem. */
static inline int
__gthread_objc_close_thread_system(void)
{
/* Backend thread functions */
-/* Create a new thread of execution. */
+/* Create a new thread of execution. */
static inline objc_thread_t
__gthread_objc_thread_detach(void (* func)(void *), void * UNUSED(arg))
{
return NULL;
}
-/* Set the current thread's priority. */
+/* Set the current thread's priority. */
static inline int
__gthread_objc_thread_set_priority(int UNUSED(priority))
{
return -1;
}
-/* Return the current thread's priority. */
+/* Return the current thread's priority. */
static inline int
__gthread_objc_thread_get_priority(void)
{
return OBJC_THREAD_INTERACTIVE_PRIORITY;
}
-/* Yield our process time to another thread. */
+/* Yield our process time to another thread. */
static inline void
__gthread_objc_thread_yield(void)
{
return;
}
-/* Terminate the current thread. */
+/* Terminate the current thread. */
static inline int
__gthread_objc_thread_exit(void)
{
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
__gthread_objc_thread_id(void)
{
- /* No thread support, use 1. */
+ /* No thread support, use 1. */
return (objc_thread_t)1;
}
-/* Sets the thread's local storage pointer. */
+/* Sets the thread's local storage pointer. */
static inline int
__gthread_objc_thread_set_data(void *value)
{
return 0;
}
-/* Returns the thread's local storage pointer. */
+/* Returns the thread's local storage pointer. */
static inline void *
__gthread_objc_thread_get_data(void)
{
/* Backend mutex functions */
-/* Allocate a mutex. */
+/* Allocate a mutex. */
static inline int
__gthread_objc_mutex_allocate(objc_mutex_t UNUSED(mutex))
{
return 0;
}
-/* Deallocate a mutex. */
+/* Deallocate a mutex. */
static inline int
__gthread_objc_mutex_deallocate(objc_mutex_t UNUSED(mutex))
{
return 0;
}
-/* Grab a lock on a mutex. */
+/* Grab a lock on a mutex. */
static inline int
__gthread_objc_mutex_lock(objc_mutex_t UNUSED(mutex))
{
return 0;
}
-/* Try to grab a lock on a mutex. */
+/* Try to grab a lock on a mutex. */
static inline int
__gthread_objc_mutex_trylock(objc_mutex_t UNUSED(mutex))
{
/* Backend condition mutex functions */
-/* Allocate a condition. */
+/* Allocate a condition. */
static inline int
__gthread_objc_condition_allocate(objc_condition_t UNUSED(condition))
{
return 0;
}
-/* Deallocate a condition. */
+/* Deallocate a condition. */
static inline int
__gthread_objc_condition_deallocate(objc_condition_t UNUSED(condition))
{
return 0;
}
-/* Wake up all threads waiting on this condition. */
+/* Wake up all threads waiting on this condition. */
static inline int
__gthread_objc_condition_broadcast(objc_condition_t UNUSED(condition))
{
return 0;
}
-/* Wake up one thread waiting on this condition. */
+/* Wake up one thread waiting on this condition. */
static inline int
__gthread_objc_condition_signal(objc_condition_t UNUSED(condition))
{
/* Solaris threads as found in Solaris 2.[456].
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
#endif
/* 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;
/* Backend initialization functions */
-/* Initialize the threads subsystem. */
+/* Initialize the threads subsystem. */
static inline int
__gthread_objc_init_thread_system(void)
{
return -1;
}
-/* Close the threads subsystem. */
+/* Close the threads subsystem. */
static inline int
__gthread_objc_close_thread_system(void)
{
/* Backend thread functions */
-/* Create a new thread of execution. */
+/* Create a new thread of execution. */
static inline objc_thread_t
__gthread_objc_thread_detach(void (*func)(void *), void *arg)
{
return thread_id;
}
-/* Set the current thread's priority. */
+/* Set the current thread's priority. */
static inline int
__gthread_objc_thread_set_priority(int priority)
{
return -1;
}
-/* Return the current thread's priority. */
+/* Return the current thread's priority. */
static inline int
__gthread_objc_thread_get_priority(void)
{
return OBJC_THREAD_LOW_PRIORITY;
}
- /* Couldn't get priority. */
+ /* Couldn't get priority. */
return -1;
}
-/* Yield our process time to another thread. */
+/* Yield our process time to another thread. */
static inline void
__gthread_objc_thread_yield(void)
{
thr_yield();
}
-/* Terminate the current thread. */
+/* Terminate the current thread. */
static inline int
__gthread_objc_thread_exit(void)
{
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
__gthread_objc_thread_id(void)
{
return (objc_thread_t)1;
}
-/* Sets the thread's local storage pointer. */
+/* Sets the thread's local storage pointer. */
static inline int
__gthread_objc_thread_set_data(void *value)
{
}
}
-/* Returns the thread's local storage pointer. */
+/* Returns the thread's local storage pointer. */
static inline void *
__gthread_objc_thread_get_data(void)
{
/* Backend mutex functions */
-/* Allocate a mutex. */
+/* Allocate a mutex. */
static inline int
__gthread_objc_mutex_allocate(objc_mutex_t mutex)
{
return 0;
}
-/* Deallocate a mutex. */
+/* Deallocate a mutex. */
static inline int
__gthread_objc_mutex_deallocate(objc_mutex_t mutex)
{
return 0;
}
-/* Grab a lock on a mutex. */
+/* Grab a lock on a mutex. */
static inline int
__gthread_objc_mutex_lock(objc_mutex_t mutex)
{
return 0;
}
-/* Try to grab a lock on a mutex. */
+/* Try to grab a lock on a mutex. */
static inline int
__gthread_objc_mutex_trylock(objc_mutex_t mutex)
{
/* Backend condition mutex functions */
-/* Allocate a condition. */
+/* Allocate a condition. */
static inline int
__gthread_objc_condition_allocate(objc_condition_t condition)
{
return 0;
}
-/* Deallocate a condition. */
+/* Deallocate a condition. */
static inline int
__gthread_objc_condition_deallocate(objc_condition_t condition)
{
return 0;
}
-/* Wake up all threads waiting on this condition. */
+/* Wake up all threads waiting on this condition. */
static inline int
__gthread_objc_condition_broadcast(objc_condition_t condition)
{
return 0;
}
-/* Wake up one thread waiting on this condition. */
+/* Wake up one thread waiting on this condition. */
static inline int
__gthread_objc_condition_signal(objc_condition_t condition)
{
__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
- got a reasonable key value, and if not, fail. */
+ got a reasonable key value, and if not, fail. */
*key = -1;
if (thr_keycreate (key, dtor) != 0 || *key == -1)
return -1;
static inline int
__gthread_key_dtor (__gthread_key_t key, void *ptr)
{
- /* Nothing needed. */
+ /* Nothing needed. */
return 0;
}
static inline int
__gthread_key_delete (__gthread_key_t key)
{
- /* Not possible. */
+ /* Not possible. */
return -1;
}
/* Backend initialization functions */
-/* Initialize the threads subsystem. */
+/* Initialize the threads subsystem. */
int
__gthread_objc_init_thread_system(void)
{
return -1;
}
-/* Close the threads subsystem. */
+/* Close the threads subsystem. */
int
__gthread_objc_close_thread_system(void)
{
/* Backend thread functions */
-/* Create a new thread of execution. */
+/* Create a new thread of execution. */
objc_thread_t
__gthread_objc_thread_detach(void (*func)(void *arg), void *arg)
{
return NULL;
}
-/* Set the current thread's priority. */
+/* Set the current thread's priority. */
int
__gthread_objc_thread_set_priority(int priority)
{
return -1;
}
-/* Return the current thread's priority. */
+/* Return the current thread's priority. */
int
__gthread_objc_thread_get_priority(void)
{
return OBJC_THREAD_INTERACTIVE_PRIORITY;
}
-/* Yield our process time to another thread. */
+/* Yield our process time to another thread. */
void
__gthread_objc_thread_yield(void)
{
return;
}
-/* Terminate the current thread. */
+/* Terminate the current thread. */
int
__gthread_objc_thread_exit(void)
{
return -1;
}
-/* Returns an integer value which uniquely describes a thread. */
+/* Returns an integer value which uniquely describes a thread. */
objc_thread_t
__gthread_objc_thread_id(void)
{
- /* No thread support, use 1. */
+ /* No thread support, use 1. */
return (objc_thread_t)1;
}
-/* Sets the thread's local storage pointer. */
+/* Sets the thread's local storage pointer. */
int
__gthread_objc_thread_set_data(void *value)
{
return 0;
}
-/* Returns the thread's local storage pointer. */
+/* Returns the thread's local storage pointer. */
void *
__gthread_objc_thread_get_data(void)
{
/* Backend mutex functions */
-/* Allocate a mutex. */
+/* Allocate a mutex. */
int
__gthread_objc_mutex_allocate(objc_mutex_t mutex)
{
return 0;
}
-/* Deallocate a mutex. */
+/* Deallocate a mutex. */
int
__gthread_objc_mutex_deallocate(objc_mutex_t mutex)
{
return 0;
}
-/* Grab a lock on a mutex. */
+/* Grab a lock on a mutex. */
int
__gthread_objc_mutex_lock(objc_mutex_t mutex)
{
return 0;
}
-/* Try to grab a lock on a mutex. */
+/* Try to grab a lock on a mutex. */
int
__gthread_objc_mutex_trylock(objc_mutex_t mutex)
{
/* Backend condition mutex functions */
-/* Allocate a condition. */
+/* Allocate a condition. */
int
__gthread_objc_condition_allocate(objc_condition_t condition)
{
return 0;
}
-/* Deallocate a condition. */
+/* Deallocate a condition. */
int
__gthread_objc_condition_deallocate(objc_condition_t condition)
{
return 0;
}
-/* Wake up all threads waiting on this condition. */
+/* Wake up all threads waiting on this condition. */
int
__gthread_objc_condition_broadcast(objc_condition_t condition)
{
return 0;
}
-/* Wake up one thread waiting on this condition. */
+/* Wake up one thread waiting on this condition. */
int
__gthread_objc_condition_signal(objc_condition_t condition)
{
#else /* _LIBOBJC */
/* 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
static inline int
__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)
return __gthread_setspecific (key, 0);
else
/* Backend initialization functions */
-/* Initialize the threads subsystem. */
+/* Initialize the threads subsystem. */
int
__gthread_objc_init_thread_system(void)
{
return -1;
}
-/* Close the threads subsystem. */
+/* Close the threads subsystem. */
int
__gthread_objc_close_thread_system(void)
{
/* Backend thread functions */
-/* Create a new thread of execution. */
+/* Create a new thread of execution. */
objc_thread_t
__gthread_objc_thread_detach(void (*func)(void *arg), void *arg)
{
return (objc_thread_t)thread_id;
}
-/* Set the current thread's priority. */
+/* Set the current thread's priority. */
int
__gthread_objc_thread_set_priority(int priority)
{
return -1;
}
-/* Return the current thread's priority. */
+/* Return the current thread's priority. */
int
__gthread_objc_thread_get_priority(void)
{
return OBJC_THREAD_LOW_PRIORITY;
}
- /* Couldn't get priority. */
+ /* Couldn't get priority. */
return -1;
}
-/* Yield our process time to another thread. */
+/* Yield our process time to another thread. */
void
__gthread_objc_thread_yield(void)
{
Sleep(0);
}
-/* Terminate the current thread. */
+/* Terminate the current thread. */
int
__gthread_objc_thread_exit(void)
{
return -1;
}
-/* Returns an integer value which uniquely describes a thread. */
+/* Returns an integer value which uniquely describes a thread. */
objc_thread_t
__gthread_objc_thread_id(void)
{
return (objc_thread_t)GetCurrentThreadId();
}
-/* Sets the thread's local storage pointer. */
+/* Sets the thread's local storage pointer. */
int
__gthread_objc_thread_set_data(void *value)
{
return -1;
}
-/* Returns the thread's local storage pointer. */
+/* Returns the thread's local storage pointer. */
void *
__gthread_objc_thread_get_data(void)
{
/* Backend mutex functions */
-/* Allocate a mutex. */
+/* Allocate a mutex. */
int
__gthread_objc_mutex_allocate(objc_mutex_t mutex)
{
return 0;
}
-/* Deallocate a mutex. */
+/* Deallocate a mutex. */
int
__gthread_objc_mutex_deallocate(objc_mutex_t mutex)
{
return 0;
}
-/* Grab a lock on a mutex. */
+/* Grab a lock on a mutex. */
int
__gthread_objc_mutex_lock(objc_mutex_t mutex)
{
return 0;
}
-/* Try to grab a lock on a mutex. */
+/* Try to grab a lock on a mutex. */
int
__gthread_objc_mutex_trylock(objc_mutex_t mutex)
{
/* Backend condition mutex functions */
-/* Allocate a condition. */
+/* Allocate a condition. */
int
__gthread_objc_condition_allocate(objc_condition_t condition)
{
- /* Unimplemented. */
+ /* Unimplemented. */
return -1;
}
-/* Deallocate a condition. */
+/* Deallocate a condition. */
int
__gthread_objc_condition_deallocate(objc_condition_t condition)
{
- /* Unimplemented. */
+ /* Unimplemented. */
return -1;
}
int
__gthread_objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
{
- /* Unimplemented. */
+ /* Unimplemented. */
return -1;
}
-/* Wake up all threads waiting on this condition. */
+/* Wake up all threads waiting on this condition. */
int
__gthread_objc_condition_broadcast(objc_condition_t condition)
{
- /* Unimplemented. */
+ /* Unimplemented. */
return -1;
}
-/* Wake up one thread waiting on this condition. */
+/* Wake up one thread waiting on this condition. */
int
__gthread_objc_condition_signal(objc_condition_t condition)
{
- /* Unimplemented. */
+ /* Unimplemented. */
return -1;
}
static inline int
__gthread_key_dtor (__gthread_key_t key, void *ptr)
{
- /* Nothing needed. */
+ /* Nothing needed. */
return 0;
}