libftdi Archives

Subject: Re: [PATCH] Allow to interrupt ftdi_transfer_data_done() by signals

From: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Cc: Michał Semeniuk <michal.jozef.semeniuk@xxxxxxxxx>
Date: Thu, 28 Jul 2016 16:17:44 +0200
Hello Michal,

On Friday, 15. July 2016 14:23:03 Michał Semeniuk wrote:
> I would like to propose a patch which allow to not block signals
> during execution of ftdi_transfer_data_done() function.
> If we would like to have possibility to interrupt the
> ftdi_transfer_data_done by signals we should use call the new function
> ftdi_transfer_set_sigblock() before calling ftdi_transfer_data_done(),
> example workflow:
> 
> ctrl = ftdi_write_data_submit() / ftdi_read_data_submit()
> ftdi_transfer_set_sigblock(ctrl, 0);
> ftdi_transfer_data_done(ctrl); // now signals can interrupt
> ftdi_transfer_data_done()
> 
> If we don't call ftdi_transfer_set_sigblock() we will have the old
> behaviour: the ftdi_transfer_data_done() will not be interrupted by
> signals:

your patch looks good.

One question though: What happens to the tc once a signal triggered?
As far as I can tell, libusb_cancel_transfer(tc->transfer) is called.

-> How do you "recover" / handle the signal?

Cheers,
Thomas


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx

Current Thread