server: Create a thread message queue shared mapping.

This commit is contained in:
Rémi Bernon 2024-02-19 22:37:36 +01:00 committed by Alexandre Julliard
parent b89c3a41bb
commit fd3de9005e
3 changed files with 21 additions and 1 deletions

View file

@ -897,9 +897,15 @@ typedef volatile struct
unsigned char keystate[256];
} desktop_shm_t;
typedef volatile struct
{
int placeholder;
} queue_shm_t;
typedef volatile union
{
desktop_shm_t desktop;
queue_shm_t queue;
} object_shm_t;
typedef volatile struct
@ -6569,7 +6575,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 815
#define SERVER_PROTOCOL_VERSION 816
/* ### protocol_version end ### */

View file

@ -913,9 +913,15 @@ typedef volatile struct
unsigned char keystate[256]; /* asynchronous key state */
} desktop_shm_t;
typedef volatile struct
{
int placeholder;
} queue_shm_t;
typedef volatile union
{
desktop_shm_t desktop;
queue_shm_t queue;
} object_shm_t;
typedef volatile struct

View file

@ -146,6 +146,7 @@ struct msg_queue
struct hook_table *hooks; /* hook table */
timeout_t last_get_msg; /* time of last get message call */
int keystate_lock; /* owns an input keystate lock */
const queue_shm_t *shared; /* queue in session shared memory */
};
struct hotkey
@ -321,6 +322,12 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
list_init( &queue->expired_timers );
for (i = 0; i < NB_MSG_KINDS; i++) list_init( &queue->msg_list[i] );
if (!(queue->shared = alloc_shared_object()))
{
release_object( queue );
return NULL;
}
thread->queue = queue;
}
if (new_input) release_object( new_input );
@ -1210,6 +1217,7 @@ static void msg_queue_destroy( struct object *obj )
release_object( queue->input );
if (queue->hooks) release_object( queue->hooks );
if (queue->fd) release_object( queue->fd );
if (queue->shared) free_shared_object( queue->shared );
}
static void msg_queue_poll_event( struct fd *fd, int event )