Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aleksandr Isakov
wine-fonts
Commits
3153d8d1
Commit
3153d8d1
authored
Jul 06, 2020
by
Zebediah Figura
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Create eventfd file descriptors for message queues.
parent
43bb9c57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
queue.c
server/queue.c
+29
-1
No files found.
server/queue.c
View file @
3153d8d1
...
...
@@ -41,6 +41,7 @@
#include "process.h"
#include "request.h"
#include "user.h"
#include "esync.h"
#define WM_NCMOUSEFIRST WM_NCMOUSEMOVE
#define WM_NCMOUSELAST (WM_NCMOUSEFIRST+(WM_MOUSELAST-WM_MOUSEFIRST))
...
...
@@ -142,6 +143,7 @@ struct msg_queue
timeout_t
last_get_msg
;
/* time of last get message call */
int
keystate_lock
;
/* owns an input keystate lock */
unsigned
int
ignore_post_msg
;
/* ignore post messages newer than this unique id */
int
esync_fd
;
/* esync file descriptor (signalled on message) */
};
struct
hotkey
...
...
@@ -158,6 +160,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
);
static
int
msg_queue_get_esync_fd
(
struct
object
*
obj
,
enum
esync_type
*
type
);
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
);
...
...
@@ -173,7 +176,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 */
NULL
,
/* get_esync_fd */
msg_queue_get_esync_fd
,
/* get_esync_fd */
msg_queue_satisfied
,
/* satisfied */
no_signal
,
/* signal */
no_get_fd
,
/* get_fd */
...
...
@@ -313,12 +316,16 @@ 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
;
queue
->
esync_fd
=
-
1
;
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
]
);
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
(
queue
->
keystate_lock
)
unlock_input_keystate
(
queue
->
input
);
queue
->
keystate_lock
=
0
;
}
if
(
do_esync
()
&&
!
is_signaled
(
queue
))
esync_clear
(
queue
->
esync_fd
);
}
/* check whether msg is a keyboard message */
...
...
@@ -1046,6 +1056,13 @@ static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entr
return
ret
||
is_signaled
(
queue
);
}
static
int
msg_queue_get_esync_fd
(
struct
object
*
obj
,
enum
esync_type
*
type
)
{
struct
msg_queue
*
queue
=
(
struct
msg_queue
*
)
obj
;
*
type
=
ESYNC_QUEUE
;
return
queue
->
esync_fd
;
}
static
void
msg_queue_satisfied
(
struct
object
*
obj
,
struct
wait_queue_entry
*
entry
)
{
struct
msg_queue
*
queue
=
(
struct
msg_queue
*
)
obj
;
...
...
@@ -1090,6 +1107,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
(
do_esync
())
close
(
queue
->
esync_fd
);
}
static
void
msg_queue_poll_event
(
struct
fd
*
fd
,
int
event
)
...
...
@@ -2463,6 +2481,9 @@ DECL_HANDLER(set_queue_mask)
if
(
req
->
skip_wait
)
queue
->
wake_mask
=
queue
->
changed_mask
=
0
;
else
wake_up
(
&
queue
->
obj
,
0
);
}
if
(
do_esync
()
&&
!
is_signaled
(
queue
))
esync_clear
(
queue
->
esync_fd
);
}
}
...
...
@@ -2476,6 +2497,9 @@ DECL_HANDLER(get_queue_status)
reply
->
wake_bits
=
queue
->
wake_bits
;
reply
->
changed_bits
=
queue
->
changed_bits
;
queue
->
changed_bits
&=
~
req
->
clear_bits
;
if
(
do_esync
()
&&
!
is_signaled
(
queue
))
esync_clear
(
queue
->
esync_fd
);
}
else
reply
->
wake_bits
=
reply
->
changed_bits
=
0
;
}
...
...
@@ -2724,6 +2748,10 @@ DECL_HANDLER(get_message)
queue
->
wake_mask
=
req
->
wake_mask
;
queue
->
changed_mask
=
req
->
changed_mask
;
set_error
(
STATUS_PENDING
);
/* FIXME */
if
(
do_esync
()
&&
!
is_signaled
(
queue
))
esync_clear
(
queue
->
esync_fd
);
return
;
found_msg
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment