Revision 61a46217

b/cpu-defs.h
205 205
    /* user data */                                                     \
206 206
    void *opaque;                                                       \
207 207
                                                                        \
208
    uint32_t created;                                                   \
209 208
    uint32_t stop;   /* Stop request */                                 \
210 209
    uint32_t stopped; /* Artificially stopped */                        \
211 210
    struct QemuCond *halt_cond;                                         \
b/cpus.c
746 746
    qemu_kvm_init_cpu_signals(env);
747 747

  
748 748
    /* signal CPU creation */
749
    env->created = 1;
749
    cpu->created = true;
750 750
    qemu_cond_signal(&qemu_cpu_cond);
751 751

  
752 752
    while (1) {
......
781 781
    sigaddset(&waitset, SIG_IPI);
782 782

  
783 783
    /* signal CPU creation */
784
    env->created = 1;
784
    cpu->created = true;
785 785
    qemu_cond_signal(&qemu_cpu_cond);
786 786

  
787 787
    cpu_single_env = env;
......
818 818
    /* signal CPU creation */
819 819
    qemu_mutex_lock(&qemu_global_mutex);
820 820
    for (env = first_cpu; env != NULL; env = env->next_cpu) {
821
        cpu = ENV_GET_CPU(env);
821 822
        env->thread_id = qemu_get_thread_id();
822
        env->created = 1;
823
        cpu->created = true;
823 824
    }
824 825
    qemu_cond_signal(&qemu_cpu_cond);
825 826

  
......
996 997
#ifdef _WIN32
997 998
        cpu->hThread = qemu_thread_get_handle(cpu->thread);
998 999
#endif
999
        while (env->created == 0) {
1000
        while (!cpu->created) {
1000 1001
            qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
1001 1002
        }
1002 1003
        tcg_cpu_thread = cpu->thread;
......
1015 1016
    qemu_cond_init(env->halt_cond);
1016 1017
    qemu_thread_create(cpu->thread, qemu_kvm_cpu_thread_fn, env,
1017 1018
                       QEMU_THREAD_JOINABLE);
1018
    while (env->created == 0) {
1019
    while (!cpu->created) {
1019 1020
        qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
1020 1021
    }
1021 1022
}
......
1029 1030
    qemu_cond_init(env->halt_cond);
1030 1031
    qemu_thread_create(cpu->thread, qemu_dummy_cpu_thread_fn, env,
1031 1032
                       QEMU_THREAD_JOINABLE);
1032
    while (env->created == 0) {
1033
    while (!cpu->created) {
1033 1034
        qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
1034 1035
    }
1035 1036
}
b/include/qemu/cpu.h
54 54

  
55 55
/**
56 56
 * CPUState:
57
 * @created: Indicates whether the CPU thread has been successfully created.
57 58
 *
58 59
 * State of one CPU core or thread.
59 60
 */
......
67 68
    HANDLE hThread;
68 69
#endif
69 70
    bool thread_kicked;
71
    bool created;
70 72

  
71 73
    /* TODO Move common fields from CPUArchState here. */
72 74
};

Also available in: Unified diff