#define __gthr_nks_h
/* NKS threads specific definitions.
- Easy, since the interface is mostly one-to-one mapping. */
+ Easy, since the interface is mostly one-to-one mapping. */
#define __GTHREADS 1
/* 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 -1;
}
-/* Yield our process time to another thread. */
+/* Yield our process time to another thread. */
static inline void
__gthread_objc_thread_yield(void)
{
NXThreadYield();
}
-/* 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)
{
(objc_thread_t) NXThreadGetId();
}
-/* 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 NXKeySetValue(_objc_thread_storage, 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 -1;
}
-/* 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 NXLock((NXMutex_t *)mutex->backend);
}
-/* 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 NXCondWait((NXCond_t *)condition->backend, (NXMutex_t *)mutex->backend);
}
-/* 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 NXCondBroadcast((NXCond_t *)condition->backend);
}
-/* 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 NXKeySetValue (key, NULL);
return 0;