Cleaned up, fixed and robustified semaphore and signal related code

This commit is contained in:
Thulinma 2018-11-01 16:11:47 +01:00
parent ee9b076b76
commit 24006648f9
7 changed files with 165 additions and 131 deletions

View file

@ -83,7 +83,8 @@ void statusMonitor(void *np){
WARN_MSG("Configuration semaphore was stuck. Force-unlocking it and re-writing config.");
changed = true;
}
configLock.post();
configLock.unlink();
configLock.open(SEM_CONF, O_CREAT | O_RDWR, ACCESSPERMS, 1);
if (changed || Controller::configChanged){
Controller::writeConfig();
Controller::configChanged = false;