diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-02-12 11:59:52 +0000 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2016-02-29 14:33:11 -0500 |
commit | bc3634010c096dffd1935c0c6cf8ba37534ae3d8 (patch) | |
tree | 9c56da7859efa72eacaf9c36aa7bb42660dbffef /dix | |
parent | 9fecc4cd571641f8920f25473ce5abb3fdca8b40 (diff) |
dix: Add ClientSignalAll()
This is a variant of ClientSignal() that signals all clients with an
optional matching sleeping client, function and closure.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/dixutils.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/dix/dixutils.c b/dix/dixutils.c index 205550eb4..b6b002385 100644 --- a/dix/dixutils.c +++ b/dix/dixutils.c @@ -620,6 +620,28 @@ ClientSignal(ClientPtr client) return FALSE; } +int +ClientSignalAll(ClientPtr client, ClientSleepProcPtr function, void *closure) +{ + SleepQueuePtr q; + int count = 0; + + for (q = sleepQueue; q; q = q->next) { + if (!(client == CLIENT_SIGNAL_ANY || q->client == client)) + continue; + + if (!(function == CLIENT_SIGNAL_ANY || q->function == function)) + continue; + + if (!(closure == CLIENT_SIGNAL_ANY || q->closure == closure)) + continue; + + count += QueueWorkProc(q->function, q->client, q->closure); + } + + return count; +} + void ClientWakeup(ClientPtr client) { |