Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
90982480
Commit
90982480
authored
May 06, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Add support for suspending the thread directly in the get/set_thread_context requests.
parent
45075b2f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
thread.c
server/thread.c
+26
-6
No files found.
server/thread.c
View file @
90982480
...
@@ -1471,12 +1471,23 @@ DECL_HANDLER(get_thread_context)
...
@@ -1471,12 +1471,23 @@ DECL_HANDLER(get_thread_context)
return
;
return
;
}
}
if
(
!
(
thread
=
get_thread_from_handle
(
req
->
handle
,
THREAD_GET_CONTEXT
)))
return
;
if
(
!
(
thread
=
get_thread_from_handle
(
req
->
handle
,
THREAD_GET_CONTEXT
)))
return
;
reply
->
self
=
(
thread
==
current
);
if
(
thread
!=
current
&&
!
thread
->
context
)
if
(
thread
!=
current
&&
!
thread
->
context
)
{
{
/* thread is not suspended, retry (if it's still running) */
/* thread is not suspended, retry (if it's still running) */
if
(
thread
->
state
!=
RUNNING
)
set_error
(
STATUS_ACCESS_DENIED
);
if
(
thread
->
state
==
RUNNING
)
else
set_error
(
STATUS_PENDING
);
{
set_error
(
STATUS_PENDING
);
if
(
req
->
suspend
)
{
release_object
(
thread
);
/* make sure we have suspend access */
if
(
!
(
thread
=
get_thread_from_handle
(
req
->
handle
,
THREAD_SUSPEND_RESUME
)))
return
;
suspend_thread
(
thread
);
}
}
else
set_error
(
STATUS_ACCESS_DENIED
);
}
}
else
if
((
context
=
set_reply_data_size
(
sizeof
(
context_t
)
)))
else
if
((
context
=
set_reply_data_size
(
sizeof
(
context_t
)
)))
{
{
...
@@ -1487,7 +1498,6 @@ DECL_HANDLER(get_thread_context)
...
@@ -1487,7 +1498,6 @@ DECL_HANDLER(get_thread_context)
if
(
thread
->
context
)
copy_context
(
context
,
thread
->
context
,
req
->
flags
&
~
flags
);
if
(
thread
->
context
)
copy_context
(
context
,
thread
->
context
,
req
->
flags
&
~
flags
);
if
(
flags
)
get_thread_context
(
thread
,
context
,
flags
);
if
(
flags
)
get_thread_context
(
thread
,
context
,
flags
);
}
}
reply
->
self
=
(
thread
==
current
);
release_object
(
thread
);
release_object
(
thread
);
}
}
...
@@ -1503,12 +1513,23 @@ DECL_HANDLER(set_thread_context)
...
@@ -1503,12 +1513,23 @@ DECL_HANDLER(set_thread_context)
return
;
return
;
}
}
if
(
!
(
thread
=
get_thread_from_handle
(
req
->
handle
,
THREAD_SET_CONTEXT
)))
return
;
if
(
!
(
thread
=
get_thread_from_handle
(
req
->
handle
,
THREAD_SET_CONTEXT
)))
return
;
reply
->
self
=
(
thread
==
current
);
if
(
thread
!=
current
&&
!
thread
->
context
)
if
(
thread
!=
current
&&
!
thread
->
context
)
{
{
/* thread is not suspended, retry (if it's still running) */
/* thread is not suspended, retry (if it's still running) */
if
(
thread
->
state
!=
RUNNING
)
set_error
(
STATUS_ACCESS_DENIED
);
if
(
thread
->
state
==
RUNNING
)
else
set_error
(
STATUS_PENDING
);
{
set_error
(
STATUS_PENDING
);
if
(
req
->
suspend
)
{
release_object
(
thread
);
/* make sure we have suspend access */
if
(
!
(
thread
=
get_thread_from_handle
(
req
->
handle
,
THREAD_SUSPEND_RESUME
)))
return
;
suspend_thread
(
thread
);
}
}
else
set_error
(
STATUS_ACCESS_DENIED
);
}
}
else
if
(
context
->
cpu
==
thread
->
process
->
cpu
)
else
if
(
context
->
cpu
==
thread
->
process
->
cpu
)
{
{
...
@@ -1520,7 +1541,6 @@ DECL_HANDLER(set_thread_context)
...
@@ -1520,7 +1541,6 @@ DECL_HANDLER(set_thread_context)
}
}
else
set_error
(
STATUS_INVALID_PARAMETER
);
else
set_error
(
STATUS_INVALID_PARAMETER
);
reply
->
self
=
(
thread
==
current
);
release_object
(
thread
);
release_object
(
thread
);
}
}
...
...
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