Here's how I think this could be solved in a synchronising fashion with a mutex.
In cb_gps_timer() the section centring the map had to go down, as set_mapcenter() calls paint_track() which needs to lock the mutex on its own.
Here's how I think this could be solved in a synchronising fashion with a mutex.
In cb_gps_timer() the section centring the map had to go down, as set_mapcenter() calls paint_track() which needs to lock the mutex on its own.