Functions | |
static int | HAP_compute_res_tid_preemption_lock (void) |
static int | HAP_compute_res_tid_preemption_unlock (void) |
API to enter and exit critical section to prevent autonomous thread identifiers based preemption (HAP_COMPUTE_RES_THREADS_FOR_AUTONOMOUS_PREEMPTION) from resource manager when acquiring global mutexes (used in I/O, standard library functions like printf, user implemented serialization etc.)
|
inlinestatic |
API to enter critical section to prevent autonomous thread identifiers based preemption (HAP_COMPUTE_RES_THREADS_FOR_AUTONOMOUS_PREEMPTION) from resource manager when acquiring global mutexes (used in I/O, standard library functions like printf, user implemented serialization etc.)
On architectures supporting HAP_COMPUTE_RES_THREADS_FOR_AUTONOMOUS_PREEMPTION, holding global mutexes can lead to deadlocks within the preempted task's user process. The critical section exposed by this API should be implemented by users around I/O, logging or any standard libraries/user implementations which acquires global mutexes.
Implementation uses a per-process global mutex, callers of this API will be serialized across threads within the caller user process on NSP.
NOTE: The critical section implementation should only be done when,
|
inlinestatic |
Releases the critical section acquired by HAP_compute_res_tid_preemption_lock().