Skip to content

Commit 56b1caa

Browse files
dgrove-ossdas
authored andcommitted
define WORKQ_PRIO_INVALID constant
Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
1 parent c4a1636 commit 56b1caa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/queue.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,10 @@ struct dispatch_root_queue_context_s {
199199
};
200200
typedef struct dispatch_root_queue_context_s *dispatch_root_queue_context_t;
201201

202+
#define WORKQ_PRIO_INVALID (-1)
202203
#ifdef __linux__
203-
#define WORKQ_BG_PRIOQUEUE_CONDITIONAL (-1)
204-
#define WORKQ_HIGH_PRIOQUEUE_CONDITIONAL (-1)
204+
#define WORKQ_BG_PRIOQUEUE_CONDITIONAL WORKQ_PRIO_INVALID
205+
#define WORKQ_HIGH_PRIOQUEUE_CONDITIONAL WORKQ_PRIO_INVALID
205206
#else
206207
#define WORKQ_BG_PRIOQUEUE_CONDITIONAL WORKQ_BG_PRIOQUEUE
207208
#define WORKQ_HIGH_PRIOQUEUE_CONDITIONAL WORKQ_HIGH_PRIOQUEUE
@@ -818,7 +819,7 @@ _dispatch_root_queues_init_workq(void)
818819
dispatch_root_queue_context_t qc;
819820
qc = &_dispatch_root_queue_contexts[i];
820821
#if DISPATCH_USE_LEGACY_WORKQUEUE_FALLBACK
821-
if (!disable_wq && qc->dgq_wq_priority != -1) {
822+
if (!disable_wq && qc->dgq_wq_priority != WORKQ_PRIO_INVALID) {
822823
r = pthread_workqueue_attr_setqueuepriority_np(&pwq_attr,
823824
qc->dgq_wq_priority);
824825
(void)dispatch_assume_zero(r);

0 commit comments

Comments
 (0)