File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1219,11 +1219,11 @@ static void* callback_thread(void* user_data)
12191219
12201220 /* We stop the thread if by the moment there are no events left in the queue there are no callbacks left */
12211221 while (1 ) {
1222- /* 5 msec timeout seems reasonable; don't set too low to avoid high CPU usage */
1223- /* This timeout only affects how much time it takes to stop the thread */
1222+ /* Pretty much any value between 2 and 100 msec timeout seems reasonable; don't set too low to avoid high CPU usage */
1223+ /* This timeout only affects how much time it takes to stop the thread if for any reason thread shutdown wasn't triggered by condition varaiable */
12241224 hidapi_timespec ts ;
12251225 hidapi_thread_gettime (& ts );
1226- hidapi_thread_addtime (& ts , 5 );
1226+ hidapi_thread_addtime (& ts , 100 );
12271227
12281228 /* Make the tread fall asleep and wait for a condition to wake it up */
12291229 hidapi_thread_cond_timedwait (& hid_hotplug_context .callback_thread , & ts );
You can’t perform that action at this time.
0 commit comments