Lines 46-52
Link Here
|
46 |
|
46 |
|
47 |
static int |
47 |
static int |
48 |
create_thread (struct pthread *pd, const struct pthread_attr *attr, |
48 |
create_thread (struct pthread *pd, const struct pthread_attr *attr, |
49 |
bool stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran) |
49 |
bool *stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran) |
50 |
{ |
50 |
{ |
51 |
/* Determine whether the newly created threads has to be started |
51 |
/* Determine whether the newly created threads has to be started |
52 |
stopped since we have to set the scheduling parameters or set the |
52 |
stopped since we have to set the scheduling parameters or set the |
Lines 54-63
Link Here
|
54 |
if (attr != NULL |
54 |
if (attr != NULL |
55 |
&& (__glibc_unlikely (attr->cpuset != NULL) |
55 |
&& (__glibc_unlikely (attr->cpuset != NULL) |
56 |
|| __glibc_unlikely ((attr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0))) |
56 |
|| __glibc_unlikely ((attr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0))) |
57 |
stopped_start = true; |
57 |
*stopped_start = true; |
58 |
|
58 |
|
59 |
pd->stopped_start = stopped_start; |
59 |
pd->stopped_start = *stopped_start; |
60 |
if (__glibc_unlikely (stopped_start)) |
60 |
if (__glibc_unlikely (*stopped_start)) |
61 |
/* We make sure the thread does not run far by forcing it to get a |
61 |
/* We make sure the thread does not run far by forcing it to get a |
62 |
lock. We lock it here too so that the new thread cannot continue |
62 |
lock. We lock it here too so that the new thread cannot continue |
63 |
until we tell it to. */ |
63 |
until we tell it to. */ |
Lines 117-123
Link Here
|
117 |
/* Set the affinity mask if necessary. */ |
117 |
/* Set the affinity mask if necessary. */ |
118 |
if (attr->cpuset != NULL) |
118 |
if (attr->cpuset != NULL) |
119 |
{ |
119 |
{ |
120 |
assert (stopped_start); |
120 |
assert (*stopped_start); |
121 |
|
121 |
|
122 |
res = INTERNAL_SYSCALL (sched_setaffinity, err, 3, pd->tid, |
122 |
res = INTERNAL_SYSCALL (sched_setaffinity, err, 3, pd->tid, |
123 |
attr->cpusetsize, attr->cpuset); |
123 |
attr->cpusetsize, attr->cpuset); |
Lines 140-146
Link Here
|
140 |
/* Set the scheduling parameters. */ |
140 |
/* Set the scheduling parameters. */ |
141 |
if ((attr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0) |
141 |
if ((attr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0) |
142 |
{ |
142 |
{ |
143 |
assert (stopped_start); |
143 |
assert (*stopped_start); |
144 |
|
144 |
|
145 |
res = INTERNAL_SYSCALL (sched_setscheduler, err, 3, pd->tid, |
145 |
res = INTERNAL_SYSCALL (sched_setscheduler, err, 3, pd->tid, |
146 |
pd->schedpolicy, &pd->schedparam); |
146 |
pd->schedpolicy, &pd->schedparam); |