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
bfb45783
Commit
bfb45783
authored
Sep 30, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Oct 01, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: A thread's affinity is restricted to the process affinity.
parent
66143238
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
info.c
dlls/ntdll/tests/info.c
+5
-0
thread.c
server/thread.c
+5
-0
No files found.
dlls/ntdll/tests/info.c
View file @
bfb45783
...
@@ -947,6 +947,11 @@ static void test_affinity(void)
...
@@ -947,6 +947,11 @@ static void test_affinity(void)
status
=
pNtQueryInformationThread
(
GetCurrentThread
(),
ThreadBasicInformation
,
&
tbi
,
sizeof
(
tbi
),
NULL
);
status
=
pNtQueryInformationThread
(
GetCurrentThread
(),
ThreadBasicInformation
,
&
tbi
,
sizeof
(
tbi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
tbi
.
AffinityMask
==
2
,
"Unexpected thread affinity
\n
"
);
ok
(
tbi
.
AffinityMask
==
2
,
"Unexpected thread affinity
\n
"
);
/* The thread affinity is restricted to the process affinity */
thread_affinity
=
1
;
status
=
pNtSetInformationThread
(
GetCurrentThread
(),
ThreadAffinityMask
,
&
thread_affinity
,
sizeof
(
thread_affinity
)
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Expected STATUS_INVALID_PARAMETER, got %08x
\n
"
,
status
);
proc_affinity
=
(
1
<<
si
.
dwNumberOfProcessors
)
-
1
;
proc_affinity
=
(
1
<<
si
.
dwNumberOfProcessors
)
-
1
;
status
=
pNtSetInformationProcess
(
GetCurrentProcess
(),
ProcessAffinityMask
,
&
proc_affinity
,
sizeof
(
proc_affinity
)
);
status
=
pNtSetInformationProcess
(
GetCurrentProcess
(),
ProcessAffinityMask
,
&
proc_affinity
,
sizeof
(
proc_affinity
)
);
...
...
server/thread.c
View file @
bfb45783
...
@@ -409,6 +409,11 @@ struct thread *get_thread_from_pid( int pid )
...
@@ -409,6 +409,11 @@ struct thread *get_thread_from_pid( int pid )
void
set_thread_affinity
(
struct
thread
*
thread
,
affinity_t
affinity
)
void
set_thread_affinity
(
struct
thread
*
thread
,
affinity_t
affinity
)
{
{
if
((
affinity
&
thread
->
process
->
affinity
)
!=
affinity
)
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
}
#ifdef HAVE_SCHED_SETAFFINITY
#ifdef HAVE_SCHED_SETAFFINITY
if
(
thread
->
unix_pid
!=
-
1
)
if
(
thread
->
unix_pid
!=
-
1
)
{
{
...
...
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