Lines Matching +full:closed +full:- +full:loop

5  * SPDX-License-Identifier: Apache-2.0
14 * Its mode of operation is that it step-locks the HW
65 this->cpu_halted = true; in nce_init()
66 this->terminate = false; in nce_init()
68 NSI_SAFE_CALL(pthread_cond_init(&this->cond_cpu, NULL)); in nce_init()
69 NSI_SAFE_CALL(pthread_mutex_init(&this->mtx_cpu, NULL)); in nce_init()
94 if (this == NULL || this->cpu_halted) { in nce_terminate()
104 } else if (this->terminate == false) { in nce_terminate()
106 this->terminate = true; in nce_terminate()
108 NSI_SAFE_CALL(pthread_mutex_lock(&this->mtx_cpu)); in nce_terminate()
110 this->cpu_halted = true; in nce_terminate()
112 NSI_SAFE_CALL(pthread_cond_broadcast(&this->cond_cpu)); in nce_terminate()
113 NSI_SAFE_CALL(pthread_mutex_unlock(&this->mtx_cpu)); in nce_terminate()
139 NSI_SAFE_CALL(pthread_mutex_lock(&this->mtx_cpu)); in change_cpu_state_and_wait()
143 this->cpu_halted = halted; in change_cpu_state_and_wait()
146 NSI_SAFE_CALL(pthread_cond_broadcast(&this->cond_cpu)); in change_cpu_state_and_wait()
156 while (this->cpu_halted == halted) { in change_cpu_state_and_wait()
158 pthread_cond_wait(&this->cond_cpu, &this->mtx_cpu); in change_cpu_state_and_wait()
163 NSI_SAFE_CALL(pthread_mutex_unlock(&this->mtx_cpu)); in change_cpu_state_and_wait()
173 /* Ensure nce_boot_cpu has reached the cond loop */ in sw_wrapper()
174 NSI_SAFE_CALL(pthread_mutex_lock(&this->mtx_cpu)); in sw_wrapper()
175 NSI_SAFE_CALL(pthread_mutex_unlock(&this->mtx_cpu)); in sw_wrapper()
184 this->start_routine(); in sw_wrapper()
201 NSI_SAFE_CALL(pthread_mutex_lock(&this->mtx_cpu)); in nce_boot_cpu()
203 this->cpu_halted = false; in nce_boot_cpu()
204 this->start_routine = start_routine; in nce_boot_cpu()
212 while (this->cpu_halted == false) { in nce_boot_cpu()
213 pthread_cond_wait(&this->cond_cpu, &this->mtx_cpu); in nce_boot_cpu()
215 NSI_SAFE_CALL(pthread_mutex_unlock(&this->mtx_cpu)); in nce_boot_cpu()
217 if (this->terminate) { in nce_boot_cpu()
235 if (this->cpu_halted == true) { in nce_halt_cpu()
254 if (this->cpu_halted == false) { in nce_wake_cpu()
264 if (this->terminate) { in nce_wake_cpu()
278 return !this->cpu_halted; in nce_is_cpu_running()
287 * Note1: When the application is closed due to a SIGTERM, the path in this