When watchdog option is changed by aw_control API, the changed option should be applied at the moment.
However, current self-thread watchdog does not change the option until previous timeout is expired.
This patch is to fix the bugs for self-thread watchdog.
This patch is the part of origin patch - http://slp-info.sec.samsung.net/gerrit/#/c/3321696/
cf) Version is changed from 0.0.1 to 0.0.3 because the version including "multiple types of watchdog" patch should have been 0.0.2.
Change-Id: I792c0ecee6419d7e605a4f92fa06932c9ca5d774
Name: argos_watchdog
Summary: ARGOS library to detect application malfunctions
-Version: 0.0.1
+Version: 0.0.3
Release: 0
Group: System/Libraries
License: Apache-2.0
unsigned int* timeout;
pthread_mutex_lock(&aw_mutex);
- switch(op){
+ switch (op) {
case AW_OP_DISABLE:
thread_watchdog_running = false;
break;
case AW_OP_CHANGE_TIMEOUT:
timeout = (unsigned int*)(data);
- if(timeout == NULL){
+ if (timeout == NULL) {
ret = -1;
break;
}
ret = -1;
break;
}
+ if (ret == 0)
+ pthread_cond_signal(&aw_cond);
pthread_mutex_unlock(&aw_mutex);
return ret;