Re: [tuxdroid-user] usleep in send_daemon_disconnect()
Status: Beta
Brought to you by:
ks156
From: David B. <da...@ja...> - 2007-06-02 06:52:26
|
On Sat, 02 Jun 2007 08:16:06 +0200, neimad <ror...@gm...> wrote: > I'm itching to remove the usleep(10000) in send_daemon_disconnected() > but I want to know first: why was it here in the first place ? Same > reason as for the other usleep()s that were necessary to avoid busy > looping before select() was used ? There are 3 usleep in the code right now: 1. in id_lookup(), the RF is not connected and an id_lookup request is sent, usleep is used to wait for the answer that should be in the dongle 100ms to a few seconds later, there's nothing else to do while waiting here so usleep maybe still makes sense, no? 2. in send_daemon_disconnected() but I don't understand what it's for, I'll ask rémi on Monday but I guess we can just remove it; 3. in usb_write_TuxDroid(), we first send the request to get the status, then the USB IC stores all data in the buffer and then it's available on the USB bus, usleep is meant to wait for the data here. That's the part I'd like to change by cutting the function in 2 parts as we can process some TCP stuff while waiting for the USB. |