osqzss / bladeGPS

Real-time GPS signal simulator for bladeRF
MIT License
142 stars 66 forks source link

Enhanced synchronization among threads to avoid unnecessary spin lock #5

Closed chackn closed 8 years ago

chackn commented 8 years ago

Originally, synchronization was one direction from tx_task to GPS_task. I added pthread's conditional wait&signal synchronization to the other direction, too. It may eliminate unnecessary spin lock loop at tx_task. I also added synchronization between main task and tx_thread using pthread_join(). One more minor change is, inserted a macro definition HAVE_STRUCT_TIMESPEC to eliminate compilation error with VisualStudio.

osqzss commented 8 years ago

Thank you for your contribution