Skip to content

Commit d2f10b3

Browse files
committed
Merge branch 'master' into linux-port-hdd
2 parents fae40d1 + 394d9a1 commit d2f10b3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/queue.c

Lines changed: 4 additions & 4 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
@@ -817,8 +818,7 @@ _dispatch_root_queues_init_workq(void)
817818
pthread_workqueue_t pwq = NULL;
818819
dispatch_root_queue_context_t qc;
819820
qc = &_dispatch_root_queue_contexts[i];
820-
#if DISPATCH_USE_LEGACY_WORKQUEUE_FALLBACK
821-
if (!disable_wq && qc->dgq_wq_priority != -1) {
821+
if (!disable_wq && qc->dgq_wq_priority != WORKQ_PRIO_INVALID) {
822822
r = pthread_workqueue_attr_setqueuepriority_np(&pwq_attr,
823823
qc->dgq_wq_priority);
824824
(void)dispatch_assume_zero(r);

src/semaphore.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,7 @@ _dispatch_thread_semaphore_dispose(_dispatch_thread_semaphore_t sema)
740740
#elif USE_POSIX_SEM
741741
sem_t *s4 = (sem_t*)sema;
742742
int ret = sem_destroy(s4);
743+
free(s4);
743744
DISPATCH_SEMAPHORE_VERIFY_RET(ret);
744745
#elif USE_WIN32_SEM
745746
// XXX: signal the semaphore?

0 commit comments

Comments
 (0)