mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
dmeventd: handle signal from plugin
Add support to unmonitor device when monitor recognizes there is nothing to monitor anymore. TODO: possibly API change with return value could be also used.
This commit is contained in:
parent
9156c5d088
commit
12aa56d298
@ -1,6 +1,7 @@
|
||||
Version 1.02.110 -
|
||||
======================================
|
||||
New design for thread cooperation in dmeventd.
|
||||
Add support to allow unmonitor device from plugin itself.
|
||||
New design for thread co-operation in dmeventd.
|
||||
Dmeventd read device status with 'noflush'.
|
||||
Dmeventd closes control device when no device is monitored.
|
||||
Thin plugin for dmeventd improved percentage usage.
|
||||
|
@ -973,6 +973,17 @@ static void *_monitor_thread(void *arg)
|
||||
|
||||
_lock_mutex();
|
||||
thread->processing = 0;
|
||||
|
||||
/*
|
||||
* Thread can terminate itself from plugin via SIGALRM
|
||||
* Timer thread will not send signal while processing
|
||||
* TODO: maybe worth API change and return value for
|
||||
* _do_process_event() instead of this signal solution
|
||||
*/
|
||||
if (sigpending(&pendmask) < 0)
|
||||
log_sys_error("sigpending", "");
|
||||
else if (sigismember(&pendmask, SIGALRM))
|
||||
break;
|
||||
} else {
|
||||
_unlock_mutex();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user