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
f194d453
Commit
f194d453
authored
Jun 08, 2018
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 thread objects.
parent
b39a2cde
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
thread.c
server/thread.c
+16
-1
thread.h
server/thread.h
+1
-0
No files found.
server/thread.c
View file @
f194d453
...
...
@@ -180,6 +180,7 @@ struct type_descr thread_type =
static
void
dump_thread
(
struct
object
*
obj
,
int
verbose
);
static
int
thread_signaled
(
struct
object
*
obj
,
struct
wait_queue_entry
*
entry
);
static
int
thread_get_esync_fd
(
struct
object
*
obj
,
enum
esync_type
*
type
);
static
unsigned
int
thread_map_access
(
struct
object
*
obj
,
unsigned
int
access
);
static
void
thread_poll_event
(
struct
fd
*
fd
,
int
event
);
static
struct
list
*
thread_get_kernel_obj_list
(
struct
object
*
obj
);
...
...
@@ -193,7 +194,7 @@ static const struct object_ops thread_ops =
add_queue
,
/* add_queue */
remove_queue
,
/* remove_queue */
thread_signaled
,
/* signaled */
NULL
,
/* get_esync_fd */
thread_get_esync_fd
,
/* get_esync_fd */
no_satisfied
,
/* satisfied */
no_signal
,
/* signal */
no_get_fd
,
/* get_fd */
...
...
@@ -233,6 +234,7 @@ static inline void init_thread_structure( struct thread *thread )
thread
->
context
=
NULL
;
thread
->
teb
=
0
;
thread
->
entry_point
=
0
;
thread
->
esync_fd
=
-
1
;
thread
->
system_regs
=
0
;
thread
->
queue
=
NULL
;
thread
->
wait
=
NULL
;
...
...
@@ -381,6 +383,9 @@ struct thread *create_thread( int fd, struct process *process, const struct secu
}
}
if
(
do_esync
())
thread
->
esync_fd
=
esync_create_fd
(
0
,
0
);
set_fd_events
(
thread
->
request_fd
,
POLLIN
);
/* start listening to events */
add_process_thread
(
thread
->
process
,
thread
);
return
thread
;
...
...
@@ -460,6 +465,9 @@ static void destroy_thread( struct object *obj )
if
(
thread
->
exit_poll
)
remove_timeout_user
(
thread
->
exit_poll
);
if
(
thread
->
id
)
free_ptid
(
thread
->
id
);
if
(
thread
->
token
)
release_object
(
thread
->
token
);
if
(
do_esync
())
close
(
thread
->
esync_fd
);
}
/* dump a thread on stdout for debugging purposes */
...
...
@@ -478,6 +486,13 @@ static int thread_signaled( struct object *obj, struct wait_queue_entry *entry )
return
mythread
->
state
==
TERMINATED
&&
!
mythread
->
exit_poll
;
}
static
int
thread_get_esync_fd
(
struct
object
*
obj
,
enum
esync_type
*
type
)
{
struct
thread
*
thread
=
(
struct
thread
*
)
obj
;
*
type
=
ESYNC_MANUAL_SERVER
;
return
thread
->
esync_fd
;
}
static
unsigned
int
thread_map_access
(
struct
object
*
obj
,
unsigned
int
access
)
{
access
=
default_map_access
(
obj
,
access
);
...
...
server/thread.h
View file @
f194d453
...
...
@@ -54,6 +54,7 @@ struct thread
struct
process
*
process
;
thread_id_t
id
;
/* thread id */
struct
list
mutex_list
;
/* list of currently owned mutexes */
int
esync_fd
;
/* esync file descriptor (signalled on exit) */
unsigned
int
system_regs
;
/* which system regs have been set */
struct
msg_queue
*
queue
;
/* message queue */
struct
thread_wait
*
wait
;
/* current wait condition if sleeping */
...
...
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