Skip to content
Open
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8e89295
dispatch: adjust the print specifies to avoid some warnings (NFCI)
compnerd Nov 12, 2021
b78af30
dispatch: silence a warning on Windows (NFC)
compnerd Nov 12, 2021
bd216a1
dispatch: make assertions LLP64 friendly (NFCI)
compnerd Nov 12, 2021
a72dfbd
dispatch: host declaration of `dispatch_pthread_root_queue_observer_h…
compnerd Nov 12, 2021
220b322
dispatch: adjust for LLP64 environments
compnerd Nov 12, 2021
26a5511
dispatch: follow `os/base.h` inclusion pattern
compnerd Nov 12, 2021
7b5aa71
dispatch: exclude workgroup support on non-Apple targets
compnerd Nov 12, 2021
28c3270
os: update unix and windows base.h
compnerd Nov 12, 2021
025bbb4
windows: add a shim for Windows
compnerd Nov 12, 2021
25758bd
dispatch: exclude some mach_port_t usage
compnerd Nov 12, 2021
811b4a1
time: explicitly size the time macros
compnerd Nov 12, 2021
e597c94
dispatch: use reserved spelling for `typeof`
compnerd Nov 12, 2021
093d3a8
private: use `dispatch_qos_class_t` rather than `qos_class_t`
compnerd Nov 12, 2021
48932f3
shims: convert `_dispatch_preemption_yeild` to an expression
compnerd Nov 12, 2021
c1f3660
os: replace `__header_always_inline` with `DISPATCH_ALWAYS_INLINE`
compnerd Nov 12, 2021
956c270
shims: add a definition for `os_atomic_init`
compnerd Nov 12, 2021
0bc1ee2
dispatch: use platform specific paths for setting thread names
compnerd Nov 12, 2021
d5455e1
shims: adopt `_os_atomic_auto_dependency` from osfmk
compnerd Nov 12, 2021
9502860
dispatch: repair the signal thread construction on Windows
compnerd Nov 19, 2021
1ba15ff
dispatch: remove an unused function
compnerd Nov 12, 2021
100c055
private: remove reference to mach.h
compnerd Nov 12, 2021
8979120
dispatch: repair the context for the cooperative root queue
compnerd Nov 13, 2021
fc4eb88
Block: adjust the type constructor for Windows
compnerd Nov 13, 2021
f251ab8
Queue: make the Swift overlay build again
compnerd Nov 13, 2021
9d366f9
Voucher portability fixes.
3405691582 Nov 13, 2021
7e99220
build: add an additional installed header
compnerd Nov 13, 2021
8ca15bc
Fix initializing of dispatch_block_flags_t.
3405691582 Nov 14, 2021
be92ae7
dispatch: explicitly cast to avoid truncation warning
compnerd Nov 19, 2021
c4c3516
dispatch: remove stray `void`
compnerd Nov 19, 2021
ef765a3
shims: add a new HAVE_WAIT_ON_ADDRESS and adopt in locks
compnerd Nov 19, 2021
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
shims: convert _dispatch_preemption_yeild to an expression
Because `_dispatch_preemption_yield` is used an expression as: ~~~ ((void) (q), _dispatch_preemption_yield(n)) ~~~ we need to convert the expansion to an expression. We _could_ also just wrap the invocation into a parenthesis as an alternative approach, but this should be safe enough to let us get away with it.
  • Loading branch information
compnerd committed Nov 12, 2021
commit 48932f3279f0c3e22de19d1d6aadf70a8658043b
12 changes: 6 additions & 6 deletions src/shims/yield.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ void *_dispatch_wait_for_enqueuer(void **ptr, void **tailp);
#define _dispatch_preemption_yield_to(th, n) thread_switch(th, \
DISPATCH_YIELD_THREAD_SWITCH_OPTION, (mach_msg_timeout_t)(n))
#elif HAVE_PTHREAD_YIELD_NP
#define _dispatch_preemption_yield(n) { (void)n; pthread_yield_np(); }
#define _dispatch_preemption_yield_to(th, n) { (void)n; pthread_yield_np(); }
#define _dispatch_preemption_yield(n) ({ (void)n; pthread_yield_np(); })
#define _dispatch_preemption_yield_to(th, n) ({ (void)n; pthread_yield_np(); })
#elif defined(_WIN32)
#define _dispatch_preemption_yield(n) { (void)n; Sleep(0); }
#define _dispatch_preemption_yield_to(th, n) { (void)n; Sleep(0); }
#define _dispatch_preemption_yield(n) ({ (void)n; Sleep(0); })
#define _dispatch_preemption_yield_to(th, n) ({ (void)n; Sleep(0); })
#else
#define _dispatch_preemption_yield(n) { (void)n; sched_yield(); }
#define _dispatch_preemption_yield_to(th, n) { (void)n; sched_yield(); }
#define _dispatch_preemption_yield(n) ({ (void)n; sched_yield(); })
#define _dispatch_preemption_yield_to(th, n) ({ (void)n; sched_yield(); })
#endif // HAVE_MACH

#if DISPATCH_HAVE_YIELD_TO_ENQUEUER
Expand Down