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.
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.