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

dmeventd: wakeup timeout thread earlier

When the last entry in the timeout queue is unregistered,
wakeup sleeping condition, so the thread is deleted earlier.
So the thread resource is release earlier.

Also when monitored with tools like valgrind this eliminites reported
leak.
This commit is contained in:
Zdenek Kabelac 2014-03-10 09:40:32 +01:00
parent 2a9b62c7f9
commit 7a6c0e2425
2 changed files with 3 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.85 -
===================================
Stop timeout thread immediately when the last worker thread is finished.
Fix dmeventd logging with parallel wait event processing.
Reuse _node_send_messages() for validation of transaction_id in preload.
Transaction_id could be lower by one only when messages are prepared.

View File

@ -614,6 +614,8 @@ static void _unregister_for_timeout(struct thread_status *thread)
if (!dm_list_empty(&thread->timeout_list)) {
dm_list_del(&thread->timeout_list);
dm_list_init(&thread->timeout_list);
if (dm_list_empty(&_timeout_registry))
pthread_cond_signal(&_timeout_cond);
}
pthread_mutex_unlock(&_timeout_mutex);
}