diff options
author | daniel <danieruru@gmail.com> | 2013-01-30 13:28:33 +0900 |
---|---|---|
committer | daniel <danieruru@gmail.com> | 2013-01-30 13:28:33 +0900 |
commit | 4494ecb71854bbb625aba18a637c7e8529939735 (patch) | |
tree | e91b370168cc31f4579340e673665bb3bd9c3cc5 /libvxi11client/perlbits/perlglue.c | |
parent | 7931456d6aab98df25e92eb217a77eeea0c5b0fb (diff) |
Make wait for interrupt more useful
Diffstat (limited to 'libvxi11client/perlbits/perlglue.c')
-rw-r--r-- | libvxi11client/perlbits/perlglue.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libvxi11client/perlbits/perlglue.c b/libvxi11client/perlbits/perlglue.c index 5c6448b..096f7a7 100644 --- a/libvxi11client/perlbits/perlglue.c +++ b/libvxi11client/perlbits/perlglue.c @@ -64,7 +64,7 @@ int glue_stop_interrupt_server() { return ret; } -char* glue_wait_for_interrupt(unsigned int timeout) { +char* glue_wait_for_interrupt(int timeout) { if (interruptqueue == NULL ) { #ifdef DEBUG printf("interrupt queue is null!\n"); @@ -82,7 +82,10 @@ char* glue_wait_for_interrupt(unsigned int timeout) { g_time_val_add(&whentotimeout, timeout * 1000); lastevent = (Event*) g_async_queue_timed_pop(interruptqueue, &whentotimeout); } - else { + else if (timeout == 0) { + lastevent = (Event*) g_async_queue_try_pop(interruptqueue); + } + else if (timeout == -1) { lastevent = (Event*) g_async_queue_pop(interruptqueue); } |