concurrencykit / ck

Concurrency primitives, safe memory reclamation mechanisms and non-blocking (including lock-free) data structures designed to aid in the research, design and implementation of high performance concurrent systems developed in C99+.
http://concurrencykit.org/
Other
2.34k stars 312 forks source link

Ignore KERN_NOT_SUPPORTED from thread_policy_set on mach #189

Closed jpihlaja-bt closed 2 years ago

jpihlaja-bt commented 2 years ago

The thread_policy_set call in aff_iterate fails with KERN_NOT_SUPPORTED on M1 macbooks. The reported error from the regression tests is "Success" because thread_policy_set doesn't set errno.

This patch converts KERN_NOT_SUPPORTED into a successful return and sets errno to EINVAL on other errors. This is ok in the regression tests as there affinity binding is only advisory.

Fixes #186