* src/threads/threads-common.c (threads_preinit): Create and
authortwisti <none@none>
Wed, 2 May 2007 16:21:12 +0000 (16:21 +0000)
committertwisti <none@none>
Wed, 2 May 2007 16:21:12 +0000 (16:21 +0000)
commitada226950be7f5e8629da50caef44e288c1d2f02
tree7c3143050eea71ec011904ac0fe9e3d111656a3d
parenta75d0878a2ec17f82ce4f0a4df228619b1ebfaf6
* src/threads/threads-common.c (threads_preinit): Create and
initialize the main-thread.
(threads_table_init): Changed signature, insert main-thread and
maintain a used list too.
(threads_table_add): Use locking and maintain used list.
(threads_table_remove): Likewise.
(threads_table_get): New function.
(threads_table_get_non_daemons): Likewise.
(threads_table_first): Likewise.
(threads_table_next): Likewise.
[!NDEBUG] (threads_table_dump): Use log_* functions.
(threads_dump): Use threads-table and functions.

* src/threads/threads-common.h (threads_table_entry_t): Made a struct
and renamed nextfree to next.
(threads_table_get): Added
(threads_table_get_non_daemons): Likewise.
(threads_table_first): Likewise.
(threads_table_next): Likewise.
[!NDEBUG] (threads_table_dump): Likewise.
(threads_impl_table_init): Likewise.
(threads_table_lock): Likewise.
(threads_table_unlock): Likewise.
(threads_set_current_threadobject): Likewise.

* src/threads/native/threads.c (threadlistlock): Removed.
(threads_impl_preinit): Removed main-thread initialization code.
(threads_impl_table_init): New function.
(threads_table_lock): New function.
(threads_table_unlock): Likewise.
(threads_init): Get main-thread from threads-table and removed
thread-list code.
(threads_attach_current_thread): Likewise.
(threads_detach_thread): Removed thread-list code.
(threads_find_non_daemon_thread): Removed.
(threads_join_all_threads): Use threads_table_get_non_daemons.
src/threads/native/threads.c
src/threads/threads-common.c
src/threads/threads-common.h