Skip to content

Commit

Permalink
Intercept GC_pthread_cancel and GC_pthread_exit on Cosmo
Browse files Browse the repository at this point in the history
Issue #666 (bdwgc).

These symbols are intercepted now, to match that on Linux.

* include/gc/gc_config_macros.h [!GC_HAVE_PTHREAD_EXIT]: Check
HOST_ANDROID and __ANDROID__ macros only if GC_LINUX_THREADS.
* include/gc/gc_config_macros.h [!GC_HAVE_PTHREAD_EXIT
&& __COSMOPOLITAN__] (GC_HAVE_PTHREAD_EXIT): Define.
  • Loading branch information
ivmai committed Oct 15, 2024
1 parent 132ec49 commit 3c23252
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions include/gc/gc_config_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,12 @@ typedef long ptrdiff_t;
# endif
# endif

# if !defined(GC_HAVE_PTHREAD_EXIT) && !defined(HOST_ANDROID) \
&& !defined(__ANDROID__) \
&& (defined(GC_LINUX_THREADS) || defined(GC_SOLARIS_THREADS))
# if !defined(GC_HAVE_PTHREAD_EXIT) \
&& ((defined(GC_LINUX_THREADS) && !defined(HOST_ANDROID) \
&& !defined(__ANDROID__)) \
|| defined(GC_SOLARIS_THREADS) || defined(__COSMOPOLITAN__))
/* Intercept pthread_exit where available and needed. */
# define GC_HAVE_PTHREAD_EXIT
/* Intercept pthread_exit on Linux and Solaris. */
# if GC_GNUC_PREREQ(2, 7)
# define GC_PTHREAD_EXIT_ATTRIBUTE __attribute__((__noreturn__))
# elif defined(__NORETURN) /* used in Solaris */
Expand Down

0 comments on commit 3c23252

Please sign in to comment.