Skip to content

Commit 4adcaa4

Browse files
dlechdpgeorge
authored andcommitted
unix/mpthreadport: Fix Mac build by using SIGUSR1 if SIGRTMIN not avail.
Some platforms, like Apple, don't define SIGRTMIN, so fall back to SIGUSR1 in such a case. Fixes micropython#5659.
1 parent 1fccda0 commit 4adcaa4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ports/unix/mpthreadport.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,13 @@
3939
#include <sched.h>
4040
#include <semaphore.h>
4141

42+
// Some platforms don't have SIGRTMIN but if we do have it, use it to avoid
43+
// potential conflict with other uses of the more commonly used SIGUSR1.
44+
#ifdef SIGRTMIN
4245
#define MP_THREAD_GC_SIGNAL (SIGRTMIN + 5)
46+
#else
47+
#define MP_THREAD_GC_SIGNAL (SIGUSR1)
48+
#endif
4349

4450
// this structure forms a linked list, one node per active thread
4551
typedef struct _thread_t {

0 commit comments

Comments
 (0)