diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-10-06 08:46:35 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-10-06 20:50:37 +0300 |
commit | 6b2980ab6e8f0a1dbd176eb546cdf4aba8172092 (patch) | |
tree | 007a938f0f3586d8f0fd3f08ee22d24ef6f73ff0 /pthread_support.c | |
parent | 394b6e2909a25bb4658248cc1425a8f5b06c8e70 (diff) | |
download | bdwgc-6b2980ab6e8f0a1dbd176eb546cdf4aba8172092.tar.gz |
Define GC_thread type in a single place both for pthreads and Win32
(refactoring)
* include/private/pthread_support.h: Add title comment.
* include/private/pthread_support.h: Replace
GC_PTHREADS&&!GC_WIN32_THREADS condition to THREADS.
* include/private/pthread_support.h [GC_PTHREADS
|| GC_PTHREADS_PARAMARK]: Include pthread.h.
* include/private/pthread_support.h [GC_WIN32_THREADS] (thread_id_t):
Define as DWORD.
* include/private/pthread_support.h [!GC_NO_THREADS_DISCOVERY
&& GC_WIN32_THREADS] (GC_Thread_Rep.tm): Add in_use and long_in_use
union fields (moved from win32_threads.c).
* include/private/pthread_support.h (GC_Thread_Rep.tm.next,
GC_Thread_Rep.stack_end): Update comment.
* include/private/pthread_support.h (GC_Thread_Rep.id): Add comment.
* include/private/pthread_support.h [USE_TKILL_ON_ANDROID]
(GC_Thread_Rep.kernel_id): Move field down (to be after stack_ptr).
* include/private/pthread_support.h [GC_WIN32_THREADS && GC_PTHREADS]
(GC_Thread_Rep.pthread_id): New field (moved from win32_threads.c).
* include/private/pthread_support.h [GC_NO_FINALIZATION]
(GC_Thread_Rep.no_fnlz_pad): Likewise.
* include/private/pthread_support.h [GC_WIN32_THREADS]
(GC_Thread_Rep.last_stack_min): Likewise.
* include/private/pthread_support.h [GC_WIN32_THREADS && I386]
(GC_Thread_Rep.initial_stack_base): Likewise.
* include/private/pthread_support.h [GC_WIN32_THREADS && !MSWINCE]
(GC_Thread_Rep.handle): Likewise.
* include/private/pthread_support.h [RETRY_GET_THREAD_CONTEXT]
(GC_Thread_Rep.context_sp, GC_Thread_Rep.context_regs): Likewise.
* include/private/pthread_support.h (GC_Thread_Rep.flags): Move field
up (to be right after pthread_id one).
* include/private/pthread_support.h (FINISHED, DETACHED, MAIN_THREAD,
DISABLED_GC, DO_BLOCKING, KNOWN_FINISHED): Move macro definition up
to stay close to flags field.
* include/private/pthread_support.h [!GC_PTHREADS] (KNOWN_FINISHED):
Define to FALSE.
* include/private/pthread_support.h (DETACHED): Define only if
GC_PTHREADS.
* include/private/pthread_support.h (GC_Thread_Rep.status): Likewise.
* include/private/pthread_support.h (MAIN_THREAD, DISABLED_GC): Do not
define if GC_WIN32_THREADS.
* include/private/pthread_support.h (GC_Thread_Rep.altstack,
GC_Thread_Rep.altstack_size, GC_Thread_Rep.normstack,
GC_Thread_Rep.normstack_size): Likewise.
* include/private/pthread_support.h [GC_WIN32_THREADS] (IS_SUSPENDED):
Define macro (moved from win32_threads.c).
* include/private/pthread_support.h [MSWINCE || GC_WIN32_THREADS]
(THREAD_HANDLE): Likewise.
* include/private/pthread_support.h [GC_WIN32_THREADS]
(THREAD_TABLE_INDEX): Likewise.
* include/private/gcconfig.h [GC_WIN32_THREADS] (PUSHED_REGS_COUNT):
Likewise.
* include/private/gcconfig.h [GC_PTHREADS && !GC_PTHREADS_PARAMARK
&& !__MINGW32__] (GC_PTHREADS_PARAMARK): Likewise.
* include/private/pthread_support.h [!GC_NO_FINALIZATION]
(GC_Thread_Rep.finalizer_nested, GC_Thread_Rep.finalizer_skipped): Move
field up to be right after flags one.
* include/private/pthread_support.h [SIGNAL_BASED_STOP_WORLD]
(GC_Thread_Rep.last_stop_count, GC_Thread_Rep.ext_suspend_cnt):
Reformat comment.
* include/private/pthread_support.h (GC_Thread_Rep.traced_stack_sect):
Likewise.
* include/private/pthread_support.h (GC_inner_start_routine,
GC_start_rtn_prepare_thread): Do not declare if GC_WIN32_THREADS.
* include/private/pthread_support.h (GC_thread_exit_proc): Declare only
if GC_PTHREADS.
* pthread_start.c: Do not include pthread.h.
* pthread_support.c: Likewise.
* win32_threads.c [GC_PTHREADS || GC_WIN32_PTHREADS
|| GC_PTHREADS_PARAMARK]: Likewise.
* win32_threads.c: Include pthread_support.h instead of gc_priv.h.
* win32_threads.c [THREAD_LOCAL_ALLOC]: Do not include
thread_local_alloc.h directly.
* win32_threads.c [GC_PTHREADS] (GC_thread_exit_proc): Remove static
function declaration.
* win32_threads.c [GC_ASSERTIONS] (GC_thr_initialized, GC_threads,
GC_lookup_thread_inner): Change STATIC to GC_INNER.
* win32_threads.c (thread_id_t, GC_Thread_Rep, THREAD_TABLE_SZ,
THREAD_TABLE_INDEX, PUSHED_REGS_COUNT, GC_PTHREADS_PARAMARK): Do not
define.
* win32_threads.c (GC_lookup_thread_inner): Rename to GC_lookup_thread.
* win32_threads.c [GC_PTHREADS] (GC_lookup_pthread): Rename to
GC_lookup_by_pthread.
* win32_threads.c [GC_PTHREADS] (GC_thread_exit_proc): Change STATIC to
GC_INNER_PTHRSTART.
Diffstat (limited to 'pthread_support.c')
-rw-r--r-- | pthread_support.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/pthread_support.c b/pthread_support.c index 72e0c943..3d8a928b 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -30,7 +30,6 @@ #if defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS) -# include <pthread.h> # include <sched.h> # include <time.h> # include <errno.h> |