mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
multiple wait object support for win32 (kazu)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2013 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
e15d737181
commit
a18e524af0
3 changed files with 75 additions and 16 deletions
|
@ -630,6 +630,7 @@ static int tap_win32_open(tap_win32_overlapped_t **phandle,
|
|||
typedef struct TAPState {
|
||||
VLANClientState *vc;
|
||||
tap_win32_overlapped_t *handle;
|
||||
HANDLE tap_event;
|
||||
} TAPState;
|
||||
|
||||
static TAPState *tap_win32_state = NULL;
|
||||
|
@ -656,6 +657,7 @@ void tap_win32_poll(void)
|
|||
if (size > 0) {
|
||||
qemu_send_packet(s->vc, buf, size);
|
||||
tap_win32_free_buffer(s->handle, buf);
|
||||
SetEvent(s->tap_event);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -676,5 +678,11 @@ int tap_win32_init(VLANState *vlan, const char *ifname)
|
|||
snprintf(s->vc->info_str, sizeof(s->vc->info_str),
|
||||
"tap: ifname=%s", ifname);
|
||||
tap_win32_state = s;
|
||||
|
||||
s->tap_event = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
if (!s->tap_event) {
|
||||
fprintf(stderr, "tap-win32: Failed CreateEvent\n");
|
||||
}
|
||||
qemu_add_wait_object(s->tap_event, NULL, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue