Fix 30-second timeout on Windows for the async thread to stop

https://github.com/Hamlib/Hamlib/issues/1295
pull/1297/head
Mike Black W9MDB 2023-05-17 10:25:33 -05:00
rodzic 630f5866a7
commit 445e5070c1
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -7673,6 +7673,9 @@ static int async_data_handler_stop(RIG *rig)
{
if (async_data_handler_priv->thread_id != 0)
{
// all cleanup is done in this function so we can kill thread
// Windows was taking 30 seconds to stop without this
pthread_cancel(async_data_handler_priv->thread_id);
int err = pthread_join(async_data_handler_priv->thread_id, NULL);
if (err)
@ -7774,6 +7777,7 @@ void *async_data_handler(void *arg)
rig_debug(RIG_DEBUG_VERBOSE, "%s: Stopping async data handler thread\n",
__func__);
pthread_exit(NULL);
return NULL;
}
#endif