-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cast of struct-based pthread_t to void pointer on Win32
`THREAD_ID_TO_VPTR()` should be applied only to values of `thread_id_t` type. Another macro (`PTHREAD_TO_VPTR()`) should be defined and used for 'pthread_t' values (this matters only Win32 platform when `pthreads-win32` library is used). * include/private/pthread_support.h (THREAD_ID_TO_VPTR): Move definition upper to be near definition of `thread_id_self()`. * include/private/pthread_support.h [GC_WIN32_THREADS] (THREAD_ID_TO_VPTR): Define to `CAST_THRU_UINTPTR(void*,id)` regardless of `CYGWIN32`, `GC_WIN32_PTHREADS`, `GC_PTHREADS_PARAMARK` and `__WINPTHREADS_VERSION_MAJOR`. * include/private/pthread_support.h [!GC_WIN32_THREADS] (THREAD_ID_TO_VPTR): Redirect to `PTHREAD_TO_VPTR()`. * include/private/pthread_support.h [GC_PTHREADS || GC_PTHREADS_PARAMARK] (PTHREAD_TO_VPTR): Define (similarly as `THREAD_ID_TO_VPTR()` was defined previously); add comment. * pthread_start.c [GC_PTHREADS && !PLATFORM_THREADS && !SN_TARGET_PSP2 && DEBUG_THREADS && !GC_PTHREAD_START_STANDALONE] (GC_pthread_start_inner): Use `PTHREAD_TO_VPTR()` instead of `THREAD_ID_TO_VPTR()` (for a value of `pthread_t`). * pthread_support.c [GC_PTHREADS && !PLATFORM_THREADS && !SN_TARGET_PSP2 && DEBUG_THREADS] (GC_wrap_pthread_join, GC_start_rtn_prepare_thread, GC_wrap_pthread_create): Likewise. * pthread_support.c [GC_PTHREADS_PARAMARK && GC_ASSERTIONS && GC_WIN32_THREADS && !USE_PTHREAD_LOCKS] (NUMERIC_THREAD_ID): Likewise. * win32_threads.c [STACKPTR_CORRECTOR_AVAILABLE && GC_PTHREADS] (GC_push_stack_for): Likewise. * win32_threads.c [STACKPTR_CORRECTOR_AVAILABLE] (GC_push_stack_for): Check `GC_PTHREADS`.
- Loading branch information
Showing
4 changed files
with
22 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters