mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
qemu: add a cleanup callback function to EventNotifier
Adding a cleanup callback function to the EventNotifier struct which allows users to execute event_notifier_cleanup in a different context. Signed-off-by: Gal Hammer <ghammer@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
406d2aa2cc
commit
f87d72f5c5
3 changed files with 7 additions and 1 deletions
|
@ -19,6 +19,7 @@ int event_notifier_init(EventNotifier *e, int active)
|
|||
{
|
||||
e->event = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||
assert(e->event);
|
||||
e->cleanup = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -26,6 +27,7 @@ void event_notifier_cleanup(EventNotifier *e)
|
|||
{
|
||||
CloseHandle(e->event);
|
||||
e->event = NULL;
|
||||
e->cleanup = NULL;
|
||||
}
|
||||
|
||||
HANDLE event_notifier_get_handle(EventNotifier *e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue