summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKunhoon Baik <knhoon.baik@samsung.com>2019-04-04 16:09:50 +0900
committerKunhoon Baik <knhoon.baik@samsung.com>2019-04-04 17:04:51 +0900
commitab90b68b647474eb3ec3015081bb4e63f136ce68 (patch)
treed4b5be2abe3aa2aa9b3ab7871ed09e5c2e58843a
parent661fc7fb592be5a4039a06223bbf68ba6422021a (diff)
downloadargos_watchdog-tizen_5.5.tar.gz
argos_watchdog-tizen_5.5.tar.bz2
argos_watchdog-tizen_5.5.zip
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
-rw-r--r--packaging/argos_watchdog.spec2
-rw-r--r--src/argos_thread.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/packaging/argos_watchdog.spec b/packaging/argos_watchdog.spec
index 446b5f6..04d4b2e 100644
--- a/packaging/argos_watchdog.spec
+++ b/packaging/argos_watchdog.spec
@@ -2,7 +2,7 @@
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
diff --git a/src/argos_thread.c b/src/argos_thread.c
index 59fc4dc..1d9ecdc 100644
--- a/src/argos_thread.c
+++ b/src/argos_thread.c
@@ -83,7 +83,7 @@ int aw_control_thread(aw_op_e op, void *data)
unsigned int* timeout;
pthread_mutex_lock(&aw_mutex);
- switch(op){
+ switch (op) {
case AW_OP_DISABLE:
thread_watchdog_running = false;
break;
@@ -94,7 +94,7 @@ int aw_control_thread(aw_op_e op, void *data)
case AW_OP_CHANGE_TIMEOUT:
timeout = (unsigned int*)(data);
- if(timeout == NULL){
+ if (timeout == NULL) {
ret = -1;
break;
}
@@ -104,6 +104,8 @@ int aw_control_thread(aw_op_e op, void *data)
ret = -1;
break;
}
+ if (ret == 0)
+ pthread_cond_signal(&aw_cond);
pthread_mutex_unlock(&aw_mutex);
return ret;