Wakeup watchdog thread when watchdog option is changed (Especially, in timeout change) 87/202787/2 accepted/tizen_5.5_unified accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix accepted/tizen_6.0_unified_hotfix tizen_5.5 tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix tizen_6.0_hotfix accepted/tizen/5.5/unified/20191031.023116 accepted/tizen/5.5/unified/mobile/hotfix/20201027.090728 accepted/tizen/5.5/unified/wearable/hotfix/20201027.113349 accepted/tizen/6.0/unified/20201030.115344 accepted/tizen/6.0/unified/hotfix/20201103.004025 accepted/tizen/unified/20190410.002033 submit/tizen/20190405.134858 submit/tizen_5.5/20191031.000004 submit/tizen_5.5_mobile_hotfix/20201026.185104 submit/tizen_5.5_wearable_hotfix/20201026.184304 submit/tizen_6.0/20201029.205104 submit/tizen_6.0_hotfix/20201102.192504 submit/tizen_6.0_hotfix/20201103.114804 tizen_5.5.m2_release tizen_6.0.m2_release
authorKunhoon Baik <knhoon.baik@samsung.com>
Thu, 4 Apr 2019 07:09:50 +0000 (16:09 +0900)
committerKunhoon Baik <knhoon.baik@samsung.com>
Thu, 4 Apr 2019 08:04:51 +0000 (17:04 +0900)
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

packaging/argos_watchdog.spec
src/argos_thread.c

index 446b5f6..04d4b2e 100644 (file)
@@ -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
index 59fc4dc..1d9ecdc 100644 (file)
@@ -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;