Re: close on USB serial port hangs (read pending) on Snow Leopard
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On 18 Feb 2010, at 3:36 PM, Matthew Owings wrote:
Might I suggest not doing a blocking read. Then when you need to close the port, set a flag that tells the thread it needs to end. Then when the thread has terminated, close the port.
I'm perplexed. The nature of reading from a serial device is that the data is intermittent, and in single bytes. If I did a non-blocking read, I'd have to poll, would I not? And get nothing back from virtually all the calls? Wait. Should I be using select()? I admit to being very naive. — F _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Fritz Anderson