Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_umtx.c
Show First 20 Lines • Show All 553 Lines • ▼ Show 20 Lines | umtxq_count_pi(struct umtx_key *key, struct umtx_q **first) | ||||
if (uh != NULL) { | if (uh != NULL) { | ||||
*first = TAILQ_FIRST(&uh->head); | *first = TAILQ_FIRST(&uh->head); | ||||
return (uh->length); | return (uh->length); | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* Wake up threads waiting on an userland object by a bit mask. | |||||
*/ | |||||
int | |||||
umtxq_signal_mask(struct umtx_key *key, int n_wake, u_int bitset) | |||||
{ | |||||
struct umtxq_queue *uh; | |||||
struct umtx_q *uq, *uq_temp; | |||||
int ret; | |||||
ret = 0; | |||||
UMTXQ_LOCKED_ASSERT(umtxq_getchain(key)); | |||||
uh = umtxq_queue_lookup(key, UMTX_SHARED_QUEUE); | |||||
markj: Why is it hard-coded to SHARED_QUEUE? | |||||
Not Done Inline ActionsEXCLUSIVE_QUEUE used only by rw_lock, many umtx functions hide queue, umtxq_insert/umtxq_remove pair for example dchagin: EXCLUSIVE_QUEUE used only by rw_lock, many umtx functions hide queue, umtxq_insert/umtxq_remove… | |||||
if (uh == NULL) | |||||
Not Done Inline Actionsif (uf == NULL) return (0); Then decrease indent level by one. kib: ```
if (uf == NULL)
return (0);
```
Then decrease indent level by one. | |||||
return (0); | |||||
Not Done Inline ActionsI do not know the intent, but what if there is a hole in the queue WRT bitmask? I mean, e.g. if we have thee elements with the uq_bitset values 1, 2, 4, and bitset is 5. Then you miss the element 4. kib: I do not know the intent, but what if there is a hole in the queue WRT bitmask? I mean, e.g. | |||||
TAILQ_FOREACH_SAFE(uq, &uh->head, uq_link, uq_temp) { | |||||
if ((uq->uq_bitset & bitset) == 0) | |||||
continue; | |||||
umtxq_remove_queue(uq, UMTX_SHARED_QUEUE); | |||||
wakeup_one(uq); | |||||
if (++ret >= n_wake) | |||||
break; | |||||
} | |||||
return (ret); | |||||
} | |||||
/* | |||||
* Wake up threads waiting on an userland object. | * Wake up threads waiting on an userland object. | ||||
*/ | */ | ||||
static int | static int | ||||
umtxq_signal_queue(struct umtx_key *key, int n_wake, int q) | umtxq_signal_queue(struct umtx_key *key, int n_wake, int q) | ||||
{ | { | ||||
struct umtxq_queue *uh; | struct umtxq_queue *uh; | ||||
struct umtx_q *uq; | struct umtx_q *uq; | ||||
▲ Show 20 Lines • Show All 3,992 Lines • Show Last 20 Lines |
Why is it hard-coded to SHARED_QUEUE?