server: Use the correct thread id to set affinity.

This commit is contained in:
Alexandre Julliard 2009-11-20 11:44:54 +01:00
parent c34ca48b3e
commit a764fe8921
1 changed files with 2 additions and 2 deletions

View File

@ -415,7 +415,7 @@ void set_thread_affinity( struct thread *thread, affinity_t affinity )
return; return;
} }
#ifdef HAVE_SCHED_SETAFFINITY #ifdef HAVE_SCHED_SETAFFINITY
if (thread->unix_pid != -1) if (thread->unix_tid != -1)
{ {
cpu_set_t set; cpu_set_t set;
int i; int i;
@ -425,7 +425,7 @@ void set_thread_affinity( struct thread *thread, affinity_t affinity )
for (i = 0, mask = 1; mask; i++, mask <<= 1) for (i = 0, mask = 1; mask; i++, mask <<= 1)
if (affinity & mask) CPU_SET( i, &set ); if (affinity & mask) CPU_SET( i, &set );
if (!sched_setaffinity( thread->unix_pid, sizeof(set), &set )) if (!sched_setaffinity( thread->unix_tid, sizeof(set), &set ))
thread->affinity = affinity; thread->affinity = affinity;
else else
file_set_error(); file_set_error();