1
Network / Re: After sending a packet (seems) receiving wrong header...
« on: November 29, 2014, 02:49:58 pm »You are sharing your "header*" variables between 2 threads and you arent using a mutex which means you are more than likely getting a race condition because 1 thread is a writer.
No synchronization is needed here.
The "header_*" globals do not change and the "header" global is only written to in the main thread before the second thread launches. And even the "quit" global, which is used in both threads (one reading, one writing) does not need a mutex.