Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137330935
D31234.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.diff
View Options
diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -558,6 +558,32 @@
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);
+ if (uh == NULL)
+ return (0);
+ 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.
*/
diff --git a/sys/sys/umtxvar.h b/sys/sys/umtxvar.h
--- a/sys/sys/umtxvar.h
+++ b/sys/sys/umtxvar.h
@@ -120,6 +120,9 @@
int uq_flags;
#define UQF_UMTXQ 0x0001
+ /* Futex bitset mask */
+ u_int uq_bitset;
+
/* The thread waits on. */
struct thread *uq_thread;
@@ -207,6 +210,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, Nov 23, 1:24 PM (10 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26015043
Default Alt Text
D31234.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