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
4c57f1bd
Commit
4c57f1bd
authored
Jun 15, 2018
by
Zebediah Figura
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Create eventfd descriptors for timers.
parent
6c0379f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
timer.c
server/timer.c
+19
-1
No files found.
server/timer.c
View file @
4c57f1bd
...
...
@@ -35,6 +35,7 @@
#include "file.h"
#include "handle.h"
#include "request.h"
#include "esync.h"
static
const
WCHAR
timer_name
[]
=
{
'T'
,
'i'
,
'm'
,
'e'
,
'r'
};
...
...
@@ -61,10 +62,12 @@ struct timer
struct
thread
*
thread
;
/* thread that set the APC function */
client_ptr_t
callback
;
/* callback APC function */
client_ptr_t
arg
;
/* callback argument */
int
esync_fd
;
/* esync file descriptor */
};
static
void
timer_dump
(
struct
object
*
obj
,
int
verbose
);
static
int
timer_signaled
(
struct
object
*
obj
,
struct
wait_queue_entry
*
entry
);
static
int
timer_get_esync_fd
(
struct
object
*
obj
,
enum
esync_type
*
type
);
static
void
timer_satisfied
(
struct
object
*
obj
,
struct
wait_queue_entry
*
entry
);
static
void
timer_destroy
(
struct
object
*
obj
);
...
...
@@ -76,7 +79,7 @@ static const struct object_ops timer_ops =
add_queue
,
/* add_queue */
remove_queue
,
/* remove_queue */
timer_signaled
,
/* signaled */
NULL
,
/* get_esync_fd */
timer_get_esync_fd
,
/* get_esync_fd */
timer_satisfied
,
/* satisfied */
no_signal
,
/* signal */
no_get_fd
,
/* get_fd */
...
...
@@ -111,6 +114,10 @@ static struct timer *create_timer( struct object *root, const struct unicode_str
timer
->
period
=
0
;
timer
->
timeout
=
NULL
;
timer
->
thread
=
NULL
;
timer
->
esync_fd
=
-
1
;
if
(
do_esync
())
timer
->
esync_fd
=
esync_create_fd
(
0
,
0
);
}
}
return
timer
;
...
...
@@ -182,6 +189,9 @@ static int set_timer( struct timer *timer, timeout_t expire, unsigned int period
{
period
=
0
;
/* period doesn't make any sense for a manual timer */
timer
->
signaled
=
0
;
if
(
do_esync
())
esync_clear
(
timer
->
esync_fd
);
}
timer
->
when
=
(
expire
<=
0
)
?
expire
-
monotonic_time
:
max
(
expire
,
current_time
);
timer
->
period
=
period
;
...
...
@@ -209,6 +219,13 @@ static int timer_signaled( struct object *obj, struct wait_queue_entry *entry )
return
timer
->
signaled
;
}
static
int
timer_get_esync_fd
(
struct
object
*
obj
,
enum
esync_type
*
type
)
{
struct
timer
*
timer
=
(
struct
timer
*
)
obj
;
*
type
=
timer
->
manual
?
ESYNC_MANUAL_SERVER
:
ESYNC_AUTO_SERVER
;
return
timer
->
esync_fd
;
}
static
void
timer_satisfied
(
struct
object
*
obj
,
struct
wait_queue_entry
*
entry
)
{
struct
timer
*
timer
=
(
struct
timer
*
)
obj
;
...
...
@@ -223,6 +240,7 @@ static void timer_destroy( struct object *obj )
if
(
timer
->
timeout
)
remove_timeout_user
(
timer
->
timeout
);
if
(
timer
->
thread
)
release_object
(
timer
->
thread
);
if
(
do_esync
())
close
(
timer
->
esync_fd
);
}
/* create a timer */
...
...
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