macOS does not support sem_init. use sem_open instead

This commit is contained in:
Ryo Nakamura
2023-03-15 23:18:33 +09:00
parent e038b3020d
commit f0c70a148b
3 changed files with 43 additions and 6 deletions

View File

@@ -3,7 +3,12 @@
#include <pthread.h>
int nr_cpus();
#ifndef PSEMNAMLEN /* defined in macOS, but not in Linux */
#define PSEMNAMLEN 31
#endif
int nr_cpus(void);
int set_thread_affinity(pthread_t tid, int core);
int get_random(int max);
#endif /* _PLATFORM_H_ */