mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-30 04:48:36 +00:00
server: Create a thread message queue shared mapping.
This commit is contained in:
parent
b89c3a41bb
commit
fd3de9005e
|
@ -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 ### */
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 )
|
||||
|
|
Loading…
Reference in a new issue