|
From: Roger L. <rli...@us...> - 2007-12-03 12:11:27
|
Update of /cvsroot/javax-usb/javax-usb-ri-linux/jni In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19374/jni Modified Files: JavaxUsbDeviceProxy.c JavaxUsbKernel.h Log Message: Changed sleep in polling loop from 10ms to 1 ms. Index: JavaxUsbDeviceProxy.c =================================================================== RCS file: /cvsroot/javax-usb/javax-usb-ri-linux/jni/JavaxUsbDeviceProxy.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** JavaxUsbDeviceProxy.c 28 Nov 2007 23:54:05 -0000 1.6 --- JavaxUsbDeviceProxy.c 3 Dec 2007 11:50:30 -0000 1.7 *************** *** 33,37 **** int fd = 0; struct usbdevfs_urb *urb; - int loop_count = 0; jclass LinuxDeviceProxy; --- 33,36 ---- *************** *** 64,73 **** /* run forever...? */ while (1) { ! /* FIXME - stop using polling! */ ! if ( loop_count > 20 ) { ! usleep( 10000 ); ! loop_count = 0; ! } ! loop_count ++; if (JNI_TRUE == CheckedCallBooleanMethod( env, linuxDeviceProxy, isRequestWaiting )) { --- 63,67 ---- /* run forever...? */ while (1) { ! usleep( 1000 ); // Sleep 1 ms to avoid too much polling if (JNI_TRUE == CheckedCallBooleanMethod( env, linuxDeviceProxy, isRequestWaiting )) { Index: JavaxUsbKernel.h =================================================================== RCS file: /cvsroot/javax-usb/javax-usb-ri-linux/jni/JavaxUsbKernel.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JavaxUsbKernel.h 17 Jul 2007 20:01:37 -0000 1.5 --- JavaxUsbKernel.h 3 Dec 2007 11:50:30 -0000 1.6 *************** *** 14,21 **** //****************************************************************************** // Kernel-specific - #include <sys/utsname.h> #include <linux/usbdevice_fs.h> ! #include <linux/usb.h> // The names of this struct's fields change from 2.4 to 2.6. --- 14,20 ---- //****************************************************************************** // Kernel-specific #include <sys/utsname.h> #include <linux/usbdevice_fs.h> ! #include <linux/usb/ch9.h> // The names of this struct's fields change from 2.4 to 2.6. |