* src/mm/boehm-gc/pthread_stop_world.c (cacao_suspendhandler):
[cacao.git] / src / threads / threads-common.h
index c0d589b99248315f5d81f33c11837040d3cf1bbb..0bbf2b2bde1568c3cfe1c0b8f74c049c1a4175e9 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: threads-common.h 7825 2007-04-25 20:31:57Z twisti $
+   $Id: threads-common.h 7963 2007-05-24 10:21:16Z twisti $
 
 */
 
 
 /* thread states **************************************************************/
 
-#define THREAD_STATE_NEW              0
-#define THREAD_STATE_RUNNABLE         1
-#define THREAD_STATE_BLOCKED          2
-#define THREAD_STATE_WAITING          3
-#define THREAD_STATE_TIMED_WAITING    4
-#define THREAD_STATE_TERMINATED       5
+#define THREAD_STATE_NEW              1
+#define THREAD_STATE_RUNNABLE         2
+#define THREAD_STATE_BLOCKED          3
+#define THREAD_STATE_WAITING          4
+#define THREAD_STATE_TIMED_WAITING    5
+#define THREAD_STATE_TERMINATED       6
 
 
 /* thread priorities **********************************************************/
 
 /* function prototypes ********************************************************/
 
-threadobject *threads_create_thread(void);
-threadobject *threads_thread_create_internal(utf *name);
-void          threads_start_javathread(void *vobject);
+void          threads_preinit(void);
+
+threadobject *threads_list_first(void);
+threadobject *threads_list_next(threadobject *t);
+s4            threads_list_get_non_daemons(void);
+
+threadobject *threads_thread_new(void);
+void          threads_thread_free(threadobject *t);
+
+bool          threads_thread_start_internal(utf *name, functionptr f);
+void          threads_thread_start(java_lang_Thread *object);
+
+void          threads_thread_print_info(threadobject *t);
+
 ptrint        threads_get_current_tid(void);
-utf          *threads_thread_get_state(threadobject *thread);
+
+void          threads_thread_state_runnable(threadobject *t);
+void          threads_thread_state_waiting(threadobject *t);
+void          threads_thread_state_timed_waiting(threadobject *t);
+void          threads_thread_state_terminated(threadobject *t);
+utf          *threads_thread_get_state(threadobject *t);
+
 bool          threads_thread_is_alive(threadobject *thread);
+
 void          threads_dump(void);
 void          threads_thread_print_stacktrace(threadobject *thread);
 void          threads_print_stacktrace(void);
 
+
+/* implementation specific functions */
+
+void          threads_impl_preinit(void);
+
+void          threads_impl_table_init(void);
+void          threads_list_lock(void);
+void          threads_list_unlock(void);
+
+void          threads_set_current_threadobject(threadobject *thread);
+void          threads_impl_thread_new(threadobject *t);
+void          threads_impl_thread_free(threadobject *t);
+void          threads_impl_thread_start(threadobject *thread, functionptr f);
+
 #endif /* ENABLE_THREADS */
 
 #endif /* _THREADS_COMMON_H */