Revision 182735ef linux-user/main.c
b/linux-user/main.c | ||
---|---|---|
120 | 120 |
if (child) { |
121 | 121 |
/* Child processes created by fork() only have a single thread. |
122 | 122 |
Discard information about the parent threads. */ |
123 |
first_cpu = thread_env;
|
|
124 |
thread_env->next_cpu = NULL;
|
|
123 |
first_cpu = ENV_GET_CPU(thread_env);
|
|
124 |
first_cpu->next_cpu = NULL;
|
|
125 | 125 |
pending_cpus = 0; |
126 | 126 |
pthread_mutex_init(&exclusive_lock, NULL); |
127 | 127 |
pthread_mutex_init(&cpu_list_mutex, NULL); |
... | ... | |
148 | 148 |
Must only be called from outside cpu_arm_exec. */ |
149 | 149 |
static inline void start_exclusive(void) |
150 | 150 |
{ |
151 |
CPUArchState *other; |
|
152 | 151 |
CPUState *other_cpu; |
153 | 152 |
|
154 | 153 |
pthread_mutex_lock(&exclusive_lock); |
... | ... | |
156 | 155 |
|
157 | 156 |
pending_cpus = 1; |
158 | 157 |
/* Make all other cpus stop executing. */ |
159 |
for (other = first_cpu; other; other = other->next_cpu) { |
|
160 |
other_cpu = ENV_GET_CPU(other); |
|
158 |
for (other_cpu = first_cpu; other_cpu; other_cpu = other_cpu->next_cpu) { |
|
161 | 159 |
if (other_cpu->running) { |
162 | 160 |
pending_cpus++; |
163 | 161 |
cpu_exit(other_cpu); |
Also available in: Unified diff