summaryrefslogtreecommitdiff
path: root/daemons
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2015-10-22 12:37:18 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2015-10-22 22:34:29 +0200
commit941c6354dbf783da17851be7e38f243334a4acd6 (patch)
treeb9ec9e5865a7e4f9b7884b49b3d0cd1b927494c3 /daemons
parent02eb000f5145aa60578b4591053bff9a797e64cc (diff)
downloadlvm2-941c6354dbf783da17851be7e38f243334a4acd6.tar.gz
dmeventd: wake up timer when setting new timeout
Diffstat (limited to 'daemons')
-rw-r--r--daemons/dmeventd/dmeventd.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index 885aa9de4..bbdee8274 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -1274,11 +1274,20 @@ static int _set_timeout(struct message_data *message_data)
struct thread_status *thread;
_lock_mutex();
- if ((thread = _lookup_thread_status(message_data)))
- thread->timeout = message_data->timeout_secs;
+ thread = _lookup_thread_status(message_data);
_unlock_mutex();
- return thread ? 0 : -ENODEV;
+ if (!thread)
+ return -ENODEV;
+
+ /* Lets reprogram timer */
+ pthread_mutex_lock(&_timeout_mutex);
+ thread->timeout = message_data->timeout_secs;
+ thread->next_time = 0;
+ pthread_cond_signal(&_timeout_cond);
+ pthread_mutex_unlock(&_timeout_mutex);
+
+ return 0;
}
static int _get_timeout(struct message_data *message_data)