reactor-c
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
rti_local.c File Reference

Detailed Description

Author
Erling Jellum (erlin.nosp@m.g.r..nosp@m.jellu.nosp@m.m@nt.nosp@m.nu.no)
Edward A. Lee (eal@b.nosp@m.erke.nosp@m.ley.e.nosp@m.du)
Chadlia Jerad (chadl.nosp@m.ia.j.nosp@m.erad@.nosp@m.ensi.nosp@m.-uma..nosp@m.tn)
Soroush Bateni (sorou.nosp@m.sh@u.nosp@m.tdall.nosp@m.as.e.nosp@m.du)

This file implements the enclave coordination logic. Here we are dealing with multiple mutexes. To avoid deadlocking we follow the following rules: 1) Mutexes are always locked in the following order: Enclave mutexes followed by RTI mutex. This means that we never lock an enclave mutex while holding the RTI mutex. 2) Mutexes are always unlocked in the following order: RTI mutex followed by Enclave mutex. 3) If the coordination logic might block. We unlock the enclave mutex while blocking, using a condition variable to unblock. 4) When blocking on the coordination logic, never hold the RTI mutex.