You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase against 07544942e2c9c2f35263adb5104998f18967dc6c.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From 61e2cd91e7eb3654e6663a44d950f40808c4f30b Mon Sep 17 00:00:00 2001
|
||||
From f1fcc584ff2bb975656b9f2f111d3e09b36293d0 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <zfigura@codeweavers.com>
|
||||
Date: Mon, 6 Jul 2020 16:01:56 -0500
|
||||
Subject: [PATCH] server: Create eventfd file descriptors for message queues.
|
||||
@@ -8,10 +8,10 @@ Subject: [PATCH] server: Create eventfd file descriptors for message queues.
|
||||
1 file changed, 29 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/server/queue.c b/server/queue.c
|
||||
index 0aa8888d646..e29764f7870 100644
|
||||
index 4d3f43b8d52..74a59b2ee84 100644
|
||||
--- a/server/queue.c
|
||||
+++ b/server/queue.c
|
||||
@@ -42,6 +42,7 @@
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "process.h"
|
||||
#include "request.h"
|
||||
#include "user.h"
|
||||
@@ -19,15 +19,15 @@ index 0aa8888d646..e29764f7870 100644
|
||||
|
||||
#define WM_NCMOUSEFIRST WM_NCMOUSEMOVE
|
||||
#define WM_NCMOUSELAST (WM_NCMOUSEFIRST+(WM_MOUSELAST-WM_MOUSEFIRST))
|
||||
@@ -143,6 +144,7 @@ struct msg_queue
|
||||
timeout_t last_get_msg; /* time of last get message call */
|
||||
@@ -148,6 +149,7 @@ struct msg_queue
|
||||
int keystate_lock; /* owns an input keystate lock */
|
||||
const queue_shm_t *shared; /* queue in session shared memory */
|
||||
unsigned int ignore_post_msg; /* ignore post messages newer than this unique id */
|
||||
+ int esync_fd; /* esync file descriptor (signalled on message) */
|
||||
};
|
||||
|
||||
struct hotkey
|
||||
@@ -159,6 +161,7 @@ static void msg_queue_dump( struct object *obj, int verbose );
|
||||
@@ -164,6 +166,7 @@ static void msg_queue_dump( struct object *obj, int verbose );
|
||||
static int msg_queue_add_queue( struct object *obj, struct wait_queue_entry *entry );
|
||||
static void msg_queue_remove_queue( struct object *obj, struct wait_queue_entry *entry );
|
||||
static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entry );
|
||||
@@ -35,7 +35,7 @@ index 0aa8888d646..e29764f7870 100644
|
||||
static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry );
|
||||
static void msg_queue_destroy( struct object *obj );
|
||||
static void msg_queue_poll_event( struct fd *fd, int event );
|
||||
@@ -174,7 +177,7 @@ static const struct object_ops msg_queue_ops =
|
||||
@@ -179,7 +182,7 @@ static const struct object_ops msg_queue_ops =
|
||||
msg_queue_add_queue, /* add_queue */
|
||||
msg_queue_remove_queue, /* remove_queue */
|
||||
msg_queue_signaled, /* signaled */
|
||||
@@ -44,7 +44,7 @@ index 0aa8888d646..e29764f7870 100644
|
||||
msg_queue_satisfied, /* satisfied */
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
@@ -314,12 +317,16 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
|
||||
@@ -321,6 +324,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
|
||||
queue->last_get_msg = current_time;
|
||||
queue->keystate_lock = 0;
|
||||
queue->ignore_post_msg = 0;
|
||||
@@ -52,16 +52,17 @@ index 0aa8888d646..e29764f7870 100644
|
||||
list_init( &queue->send_result );
|
||||
list_init( &queue->callback_result );
|
||||
list_init( &queue->pending_timers );
|
||||
list_init( &queue->expired_timers );
|
||||
for (i = 0; i < NB_MSG_KINDS; i++) list_init( &queue->msg_list[i] );
|
||||
@@ -339,6 +343,9 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
|
||||
}
|
||||
SHARED_WRITE_END;
|
||||
|
||||
+ if (do_esync())
|
||||
+ queue->esync_fd = esync_create_fd( 0, 0 );
|
||||
+
|
||||
thread->queue = queue;
|
||||
}
|
||||
if (new_input) release_object( new_input );
|
||||
@@ -533,6 +540,9 @@ static inline void clear_queue_bits( struct msg_queue *queue, unsigned int bits
|
||||
|
||||
if ((desktop = get_thread_desktop( thread, 0 )))
|
||||
@@ -672,6 +679,9 @@ static inline void clear_queue_bits( struct msg_queue *queue, unsigned int bits
|
||||
if (queue->keystate_lock) unlock_input_keystate( queue->input );
|
||||
queue->keystate_lock = 0;
|
||||
}
|
||||
@@ -71,7 +72,7 @@ index 0aa8888d646..e29764f7870 100644
|
||||
}
|
||||
|
||||
/* check if message is matched by the filter */
|
||||
@@ -1040,6 +1050,13 @@ static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entr
|
||||
@@ -1213,6 +1223,13 @@ static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entr
|
||||
return ret || is_signaled( queue );
|
||||
}
|
||||
|
||||
@@ -85,15 +86,15 @@ index 0aa8888d646..e29764f7870 100644
|
||||
static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry )
|
||||
{
|
||||
struct msg_queue *queue = (struct msg_queue *)obj;
|
||||
@@ -1084,6 +1101,7 @@ static void msg_queue_destroy( struct object *obj )
|
||||
release_object( queue->input );
|
||||
@@ -1258,6 +1275,7 @@ static void msg_queue_destroy( struct object *obj )
|
||||
if (queue->hooks) release_object( queue->hooks );
|
||||
if (queue->fd) release_object( queue->fd );
|
||||
if (queue->shared) free_shared_object( queue->shared );
|
||||
+ if (do_esync()) close( queue->esync_fd );
|
||||
}
|
||||
|
||||
static void msg_queue_poll_event( struct fd *fd, int event )
|
||||
@@ -2458,6 +2476,9 @@ DECL_HANDLER(set_queue_mask)
|
||||
@@ -2962,6 +2980,9 @@ DECL_HANDLER(set_queue_mask)
|
||||
if (req->skip_wait) queue->wake_mask = queue->changed_mask = 0;
|
||||
else wake_up( &queue->obj, 0 );
|
||||
}
|
||||
@@ -103,7 +104,7 @@ index 0aa8888d646..e29764f7870 100644
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2471,6 +2492,9 @@ DECL_HANDLER(get_queue_status)
|
||||
@@ -2975,6 +2996,9 @@ DECL_HANDLER(get_queue_status)
|
||||
reply->wake_bits = queue->wake_bits;
|
||||
reply->changed_bits = queue->changed_bits;
|
||||
queue->changed_bits &= ~req->clear_bits;
|
||||
@@ -113,7 +114,7 @@ index 0aa8888d646..e29764f7870 100644
|
||||
}
|
||||
else reply->wake_bits = reply->changed_bits = 0;
|
||||
}
|
||||
@@ -2717,6 +2741,10 @@ DECL_HANDLER(get_message)
|
||||
@@ -3229,6 +3253,10 @@ DECL_HANDLER(get_message)
|
||||
queue->wake_mask = req->wake_mask;
|
||||
queue->changed_mask = req->changed_mask;
|
||||
set_error( STATUS_PENDING ); /* FIXME */
|
||||
@@ -125,5 +126,5 @@ index 0aa8888d646..e29764f7870 100644
|
||||
|
||||
found_msg:
|
||||
--
|
||||
2.40.1
|
||||
2.43.0
|
||||
|
||||
|
@@ -1,13 +1,13 @@
|
||||
From 465a4772356f406552cc20bddec820a4e197b667 Mon Sep 17 00:00:00 2001
|
||||
From 57703c0423cf2b138b93dfaf4bd993d50235e55a Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <zfigura@codeweavers.com>
|
||||
Date: Mon, 6 Jul 2020 16:11:23 -0500
|
||||
Subject: [PATCH] server, ntdll: Implement message waits.
|
||||
|
||||
---
|
||||
dlls/ntdll/unix/esync.c | 51 +++++++++++++++++++++++++++++++++++++++--
|
||||
server/protocol.def | 5 ++++
|
||||
server/protocol.def | 4 ++++
|
||||
server/queue.c | 22 ++++++++++++++++++
|
||||
3 files changed, 76 insertions(+), 2 deletions(-)
|
||||
3 files changed, 75 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c
|
||||
index 399930c444b..06d7d8babc6 100644
|
||||
@@ -105,10 +105,10 @@ index 399930c444b..06d7d8babc6 100644
|
||||
{
|
||||
struct stat st;
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 4ab6b97ba93..d28c1a6f5fa 100644
|
||||
index d4a7173776f..4a081973ca5 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3910,6 +3910,10 @@ enum esync_type
|
||||
@@ -3964,6 +3964,10 @@ enum esync_type
|
||||
unsigned int shm_idx;
|
||||
@END
|
||||
|
||||
@@ -120,18 +120,18 @@ index 4ab6b97ba93..d28c1a6f5fa 100644
|
||||
@REQ(set_keyboard_repeat)
|
||||
int enable; /* whether to enable auto-repeat */
|
||||
diff --git a/server/queue.c b/server/queue.c
|
||||
index 1568355104c..b68774d7524 100644
|
||||
index 6183c2fa686..260fb753799 100644
|
||||
--- a/server/queue.c
|
||||
+++ b/server/queue.c
|
||||
@@ -149,6 +149,7 @@ struct msg_queue
|
||||
int keystate_lock; /* owns an input keystate lock */
|
||||
@@ -150,6 +150,7 @@ struct msg_queue
|
||||
const queue_shm_t *shared; /* queue in session shared memory */
|
||||
unsigned int ignore_post_msg; /* ignore post messages newer than this unique id */
|
||||
int esync_fd; /* esync file descriptor (signalled on message) */
|
||||
+ int esync_in_msgwait; /* our thread is currently waiting on us */
|
||||
};
|
||||
|
||||
struct hotkey
|
||||
@@ -322,6 +323,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
|
||||
@@ -325,6 +326,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
|
||||
queue->keystate_lock = 0;
|
||||
queue->ignore_post_msg = 0;
|
||||
queue->esync_fd = -1;
|
||||
@@ -139,7 +139,7 @@ index 1568355104c..b68774d7524 100644
|
||||
list_init( &queue->send_result );
|
||||
list_init( &queue->callback_result );
|
||||
list_init( &queue->pending_timers );
|
||||
@@ -1115,6 +1117,10 @@ static int is_queue_hung( struct msg_queue *queue )
|
||||
@@ -1170,6 +1172,10 @@ static int is_queue_hung( struct msg_queue *queue )
|
||||
if (get_wait_queue_thread(entry)->queue == queue)
|
||||
return 0; /* thread is waiting on queue -> not hung */
|
||||
}
|
||||
@@ -150,7 +150,7 @@ index 1568355104c..b68774d7524 100644
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -3923,6 +3929,21 @@ DECL_HANDLER(update_rawinput_devices)
|
||||
@@ -4025,6 +4031,21 @@ DECL_HANDLER(update_rawinput_devices)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ index 1568355104c..b68774d7524 100644
|
||||
DECL_HANDLER(set_keyboard_repeat)
|
||||
{
|
||||
struct desktop *desktop;
|
||||
@@ -3941,3 +3962,4 @@ DECL_HANDLER(set_keyboard_repeat)
|
||||
@@ -4043,3 +4064,4 @@ DECL_HANDLER(set_keyboard_repeat)
|
||||
|
||||
release_object( desktop );
|
||||
}
|
||||
|
Reference in New Issue
Block a user