You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Omnibus to implement CFRunLoop with kevent. (#3004)
* [runloop] Set up some symbols for generic code.
CFRunLoop has a recurring abstraction for platform-specific code, but it
is a little leaky. Plug these leaks: ensure `MACH_PORT_NULL` in the
generic, non-platform context is rewritten as `CFPORT_NULL`, and ensure
that `kern_return_t` and `KERN_SUCCESS` are defined properly.
* [runloop] Remind porter these stubs are required.
New platforms must define these types and functions; it is incorrect to
not have #else cases here.
* [runloop] Implement runloop abstraction for BSD.
* [runloop] Ensure timing arithmetic is done in ns.
Fixes SR-14288.
* [runloop] Avoid pthread_main_np on OpenBSD.
During runloop testing, log messages suggest that the runloop thinks the
main thread has exited and certain runloop operations don't actually
proceed. The flag for denoting when the main thread has exited is set in
the thread-specific data destructor `__CFTSDFinalize`.
This function detects whether the thread in question is the main thread
via `pthread_main_np`, and has been observed in debugging this problem
to return 1 on apparently non-main threads on OpenBSD. This obviously
will cause the main thread exited flag to be erroneously set when
non-main threads complete their work and dispose of thread-specific
data.
Instead, use the existing `_CFMainPThread` symbol set in
`__CFInitialize` to determine the main thread. I am not sure whether the
platform `pthread_main_np` is at fault here, but since this workaround
makes the tests pass, let's use it.
0 commit comments