diff options
Diffstat (limited to 'libvxi11client')
-rw-r--r-- | libvxi11client/perlbits/Client.xs | 4 | ||||
-rw-r--r-- | libvxi11client/perlbits/perlglue.c | 7 | ||||
-rw-r--r-- | libvxi11client/perlbits/perlglue.h | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/libvxi11client/perlbits/Client.xs b/libvxi11client/perlbits/Client.xs index 1ad34e9..2727077 100644 --- a/libvxi11client/perlbits/Client.xs +++ b/libvxi11client/perlbits/Client.xs @@ -93,8 +93,8 @@ vxi_enable_srq_long(context, enable, handle) RETVAL char* -vxi_wait_for_interrupt(timeout = 0) - unsigned int timeout +vxi_wait_for_interrupt(timeout = 250) + int timeout CODE: RETVAL = glue_wait_for_interrupt(timeout); OUTPUT: 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); } diff --git a/libvxi11client/perlbits/perlglue.h b/libvxi11client/perlbits/perlglue.h index 1b29567..3f9c1cc 100644 --- a/libvxi11client/perlbits/perlglue.h +++ b/libvxi11client/perlbits/perlglue.h @@ -2,7 +2,7 @@ #include <perl.h> #include "libvxi11client.h" -char* glue_wait_for_interrupt(); +char* glue_wait_for_interrupt(int timeout); VXI11Context* glue_open(char* address, char* device); int glue_start_interrupt_server(); int glue_stop_interrupt_server(); |