Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F166705668
D31234.id92517.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D31234.id92517.diff
View Options
Index: sys/kern/kern_umtx.c
===================================================================
--- sys/kern/kern_umtx.c
+++ sys/kern/kern_umtx.c
@@ -554,6 +554,31 @@
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;
+ int ret;
+
+ ret = 0;
+ UMTXQ_LOCKED_ASSERT(umtxq_getchain(key));
+ uh = umtxq_queue_lookup(key, UMTX_SHARED_QUEUE);
+ if (uh != NULL) {
+ while ((uq = TAILQ_FIRST(&uh->head)) != NULL &&
+ (uq->uq_bitset & bitset) != 0) {
+ umtxq_remove_queue(uq, UMTX_SHARED_QUEUE);
+ wakeup_one(uq);
+ if (++ret >= n_wake)
+ return (ret);
+ }
+ }
+ return (ret);
+}
+
/*
* Wake up threads waiting on an userland object.
*/
Index: sys/sys/umtxvar.h
===================================================================
--- sys/sys/umtxvar.h
+++ sys/sys/umtxvar.h
@@ -146,6 +146,9 @@
/* The queue we on */
struct umtxq_queue *uq_cur_queue;
+
+ /* Futex bitset mask */
+ u_int uq_bitset;
};
TAILQ_HEAD(umtxq_head, umtx_q);
@@ -208,6 +211,7 @@
struct umtxq_chain *umtxq_getchain(struct umtx_key *);
void umtxq_insert_queue(struct umtx_q *, int);
void umtxq_remove_queue(struct umtx_q *, int);
+int umtxq_signal_mask(struct umtx_key *, int, u_int);
int umtxq_sleep(struct umtx_q *, const char *,
struct umtx_abs_timeout *);
void umtxq_unbusy(struct umtx_key *);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Aug 16, 7:25 PM (3 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36830628
Default Alt Text
D31234.id92517.diff (1 KB)
Attached To
Mode
D31234: umtx: Add bitset member to the struct umtx_q.
Attached
Detach File
Event Timeline
Log In to Comment