Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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
wine
wine-cw
Commits
5efe996c
Commit
5efe996c
authored
Mar 22, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Add a helper function to change a queue thread input.
parent
e9be1b40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
25 deletions
+29
-25
queue.c
server/queue.c
+29
-25
No files found.
server/queue.c
View file @
5efe996c
...
...
@@ -241,23 +241,19 @@ static struct thread_input *create_thread_input( struct thread *thread )
return
input
;
}
/* release the thread input data of a given thread */
static
inline
void
release_thread_input
(
struct
thread
*
thread
)
{
struct
thread_input
*
input
=
thread
->
queue
->
input
;
if
(
!
input
)
return
;
release_object
(
input
);
thread
->
queue
->
input
=
NULL
;
}
/* create a message queue object */
static
struct
msg_queue
*
create_msg_queue
(
struct
thread
*
thread
,
struct
thread_input
*
input
)
{
struct
thread_input
*
new_input
=
NULL
;
struct
msg_queue
*
queue
;
int
i
;
if
(
!
input
&&
!
(
input
=
create_thread_input
(
thread
)))
return
NULL
;
if
(
!
input
)
{
if
(
!
(
new_input
=
create_thread_input
(
thread
)))
return
NULL
;
input
=
new_input
;
}
if
((
queue
=
alloc_object
(
&
msg_queue_ops
)))
{
queue
->
fd
=
NULL
;
...
...
@@ -281,7 +277,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
thread
->
queue
=
queue
;
}
release_object
(
input
);
if
(
new_input
)
release_object
(
new_
input
);
return
queue
;
}
...
...
@@ -294,6 +290,20 @@ void free_msg_queue( struct thread *thread )
thread
->
queue
=
NULL
;
}
/* change the thread input data of a given thread */
static
int
assign_thread_input
(
struct
thread
*
thread
,
struct
thread_input
*
new_input
)
{
if
(
!
thread
->
queue
)
{
thread
->
queue
=
create_msg_queue
(
thread
,
new_input
);
return
thread
->
queue
!=
NULL
;
}
if
(
thread
->
queue
->
input
)
release_object
(
thread
->
queue
->
input
);
thread
->
queue
->
input
=
(
struct
thread_input
*
)
grab_object
(
new_input
);
return
1
;
}
/* get the hook table for a given thread */
struct
hook_table
*
get_queue_hooks
(
struct
thread
*
thread
)
{
...
...
@@ -917,6 +927,7 @@ int attach_thread_input( struct thread *thread_from, struct thread *thread_to )
{
struct
desktop
*
desktop
;
struct
thread_input
*
input
;
int
ret
;
if
(
!
thread_to
->
queue
&&
!
(
thread_to
->
queue
=
create_msg_queue
(
thread_to
,
NULL
)))
return
0
;
if
(
!
(
desktop
=
get_thread_desktop
(
thread_from
,
0
)))
return
0
;
...
...
@@ -930,17 +941,10 @@ int attach_thread_input( struct thread *thread_from, struct thread *thread_to )
}
release_object
(
desktop
);
if
(
thread_from
->
queue
)
{
release_thread_input
(
thread_from
);
thread_from
->
queue
->
input
=
input
;
}
else
{
if
(
!
(
thread_from
->
queue
=
create_msg_queue
(
thread_from
,
input
)))
return
0
;
}
memset
(
input
->
keystate
,
0
,
sizeof
(
input
->
keystate
)
);
return
1
;
ret
=
assign_thread_input
(
thread_from
,
input
);
if
(
ret
)
memset
(
input
->
keystate
,
0
,
sizeof
(
input
->
keystate
)
);
release_object
(
input
);
return
ret
;
}
/* detach two thread input data structures */
...
...
@@ -950,8 +954,8 @@ void detach_thread_input( struct thread *thread_from )
if
((
input
=
create_thread_input
(
thread_from
)))
{
release_thread_input
(
thread_from
);
thread_from
->
queue
->
input
=
input
;
assign_thread_input
(
thread_from
,
input
);
release_object
(
input
)
;
}
}
...
...
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