Re: Crash in reads with short timeout - race.

Xiaofan Chen <[email protected]> Tue, 24 Apr 2018 20:27:41 +0800
Newsgroups gmane.comp.lib.libusb.devel.windows
Message-ID <CAGjSPUCv2CBOhE9Hkn+ZGM-ycYvpq9-R6+Zcwn_tRnZBkETzBg@mail.gmail.com>
On Sat, Apr 14, 2018 at 2:14 AM, Travis <[email protected]> wrote:
> Greetings,
>
> Let's check the return code.  What about this:
> static int _usb_cancel_io(usb_context_t *context)
> {
>     int ret;
>     ret = _usb_abort_ep(context->dev, context->req.endpoint.endpoint);
>     if (ret == 0)
>     {
>         WaitForSingleObject(context->ol.hEvent, 1000);
>     }
>     else
>     {
>         WaitForSingleObject(context->ol.hEvent, 0);
>     }
>     return ret;
> }
>
> Use 1000 ms I think.  That should always be plenty and it will keep it from
> dead locking.
>

Hi Peter,

Any updates?


-- 
Xiaofan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot