AqualinkD
AqualinkD copied to clipboard
replace busy polling with pthread_cond_wait
There are several instances where synchronization between the main thread, and the worker threads is done through variables. Polling these variables at different intervals waiting for a state change. A better way to do this is with mutex and conditions.
Using conditions and mutexes prevents race conditions and insures consistent operation. In PDA mode this means a worker can wait on a STATUS message and make a decision then send a keypress in the ACK for the STATUS it was waiting on. No missed transitions, retries, and lost time.
updated pull request to version 2.2.2a++