1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

dmeventd: prevent busy looping on CPU

Use usleep when looping on DM_WAIT_RETRY.
This commit is contained in:
Zdenek Kabelac 2012-03-22 17:00:25 +01:00
parent b87c148499
commit 7c5feaed3b
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.84 -
====================================
Avoid busy looping on CPU when dmeventd reads event DM_WAIT_RETRY.
Ensure global mutex is being hold when working with dmeventd thread.
Drop taking timeout mutex for un/registering dmeventd monitor.
Allow section names in config file data to be quoted strings.

View File

@ -796,8 +796,10 @@ static void *_monitor_thread(void *arg)
thread->current_events = 0;
wait_error = _event_wait(thread, &task);
if (wait_error == DM_WAIT_RETRY)
if (wait_error == DM_WAIT_RETRY) {
usleep(100); /* avoid busy loop */
continue;
}
if (wait_error == DM_WAIT_FATAL)
break;