libimobiledevice / libusbmuxd

A client library to multiplex connections from and to iOS devices
https://libimobiledevice.org
GNU Lesser General Public License v2.1
574 stars 270 forks source link

usbmuxd_events_unsubscribe is blocked about 2~3 secs #123

Open yanqinglu opened 2 years ago

yanqinglu commented 2 years ago

If users don't install iTunes, the usbmuxd_events_unsubscribe will be blocked about 2~3 secs. usbmuxd_events_unsubscribe calls thread_join to wait the thread to be finished, but the sleep in usbmuxd_listen_poll delay it. Should not use the sleep function, it's better to use a event to wait for timeout, then set the event in usbmuxd_events_unsubscribe .

yanqinglu commented 2 years ago

By the way, the select calling in socket_connect also blocks the usbmuxd_events_unsubscribe