usb separate thread for resource locking and modified windows locking code