diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-12-19 07:41:39 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-12-19 07:41:39 +0300 |
commit | a9c05c0311b76b9766dc46caa9e8036f5085b129 (patch) | |
tree | 506780a4c0bc97c7f8181b4a665868dfeba66a42 | |
parent | e45120d08bd1b4dcc2184024e76b40ddfafc69ca (diff) | |
download | bdwgc-a9c05c0311b76b9766dc46caa9e8036f5085b129.tar.gz |
Document that GC_unregister_my_thread result value is dummy
* include/gc/gc.h [GC_THREADS] (GC_unregister_my_thread): Refine
comment (mention that GC_SUCCESS is always returned).
* tests/gctest.c [THREADS] (check_heap_stats): Cast call of
GC_unregister_my_thread() to void.
* win32_threads.c (GC_win32_start_inner, GC_ExitThread): Likewise.
* win32_threads.c [!CYGWIN32 && !MSWINCE && !MSWIN_XBOX1 && !NO_CRT]
(GC_endthreadex): Likewise.
-rw-r--r-- | include/gc/gc.h | 2 | ||||
-rw-r--r-- | tests/gctest.c | 2 | ||||
-rw-r--r-- | win32_threads.c | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/include/gc/gc.h b/include/gc/gc.h index 4ecc504d..a6f4ab70 100644 --- a/include/gc/gc.h +++ b/include/gc/gc.h @@ -1613,7 +1613,7 @@ GC_API void GC_CALL GC_start_mark_threads(void); /* thread, it must do this before calling GC_unregister_my_thread, */ /* most probably by saving it in a global data structure. Must not */ /* be called inside a GC callback function (except for */ - /* GC_call_with_stack_base() one). */ + /* GC_call_with_stack_base() one). Always returns GC_SUCCESS. */ GC_API int GC_CALL GC_unregister_my_thread(void); /* Stop/start the world explicitly. Not recommended for general use. */ diff --git a/tests/gctest.c b/tests/gctest.c index 86b448fe..358fbc7e 100644 --- a/tests/gctest.c +++ b/tests/gctest.c @@ -1961,7 +1961,7 @@ void check_heap_stats(void) # endif # ifdef THREADS - GC_unregister_my_thread(); /* just to check it works (for main) */ + (void)GC_unregister_my_thread(); /* just to check it works (for main) */ # endif # ifdef NO_CLOCK GC_printf("Completed %u collections\n", (unsigned)GC_get_gc_no()); diff --git a/win32_threads.c b/win32_threads.c index 9ff9dfdb..7081055c 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -1366,7 +1366,7 @@ STATIC void *GC_CALLBACK GC_win32_start_inner(struct GC_stack_base *sb, __finally # endif { - GC_unregister_my_thread(); + (void)GC_unregister_my_thread(); } # ifdef DEBUG_THREADS @@ -1433,7 +1433,7 @@ GC_API HANDLE WINAPI GC_CreateThread( GC_API DECLSPEC_NORETURN void WINAPI GC_ExitThread(DWORD dwExitCode) { - GC_unregister_my_thread(); + (void)GC_unregister_my_thread(); ExitThread(dwExitCode); } @@ -1492,7 +1492,7 @@ GC_API DECLSPEC_NORETURN void WINAPI GC_ExitThread(DWORD dwExitCode) GC_API void GC_CALL GC_endthreadex(unsigned retval) { - GC_unregister_my_thread(); + (void)GC_unregister_my_thread(); _endthreadex(retval); } #endif /* !CYGWIN32 && !MSWINCE && !MSWIN_XBOX1 && !NO_CRT */ |