static mutex_t mutex_join;
static pthread_cond_t cond_join;
-/* XXX We disable that whole bunch of code until we have the exact-GC
- running. */
-
-#if 1
-
/* this is one of the STOPWORLD_FROM_ constants, telling why the world is */
/* being stopped */
static volatile int stopworldwhere;
+#if defined(ENABLE_GC_CACAO)
+
/* semaphore used for acknowleding thread suspension */
static sem_t suspend_ack;
#if defined(__IRIX__)
static pthread_cond_t suspend_cond = PTHREAD_COND_INITIALIZER;
#endif
-#endif /* 0 */
+#endif /* ENABLE_GC_CACAO */
/* mutexes used by the fake atomic instructions */
#if defined(USE_FAKE_ATOMIC_INSTRUCTIONS)
}
/* XXX We disable that whole bunch of code until we have the exact-GC
- running. */
+ running. Some of it may only be needed by the old Boehm-based
+ suspension handling. */
#if 0
}
#endif
-#endif
-
/* threads_stopworld ***********************************************************
*******************************************************************************/
-#if !defined(DISABLE_GC)
void threads_stopworld(void)
{
#if !defined(__DARWIN__) && !defined(__CYGWIN__)
non-signaled NEW threads can't change their state and execute
code. */
}
-#endif /* !defined(DISABLE_GC) */
/* threads_startworld **********************************************************
*******************************************************************************/
-#if !defined(DISABLE_GC)
void threads_startworld(void)
{
#if !defined(__DARWIN__) && !defined(__CYGWIN__)
unlock_stopworld();
}
+
#endif
vm_abort_errnum(result, "threads_impl_preinit: pthread_cond_init failed");
#if defined(ENABLE_GC_CACAO)
- /* initialize the GC mutext */
+ /* initialize the GC mutex & suspend semaphore */
mutex_init(&mutex_gc);
+ threads_sem_init(&suspend_ack, 0, 0);
#endif
#if !defined(HAVE___THREAD)
if (result != 0)
vm_abort_errnum(result, "threads_impl_preinit: pthread_key_create failed");
#endif
-
- threads_sem_init(&suspend_ack, 0, 0);
}
}
+#if defined(ENABLE_GC_CACAO)
+
/* threads_suspend_thread ******************************************************
Suspend the passed thread. Execution stops until the thread
/* TODO: remember dump memory size */
-#if defined(ENABLE_GC_CACAO)
/* inform the GC about the suspension */
if (thread->suspend_reason == SUSPEND_REASON_STOPWORLD && gc_pending) {
}
}
-#endif
/* mark this thread as suspended and remember the PC */
thread->pc = pc;
return true;
}
+#endif
/* threads_join_all_threads ****************************************************