1

global variable won't change in other thread in c

view story
linux-howto

http://stackoverflow.com – I have a global variable in c program, and my environment is Linux. When I change my global var in main thread, I see the change is right but nothing happen in other thread. My global is declared in .h file and the .c is the same file name. But if I change the global in one other thread, and the other threads will change. I have print the memory of the global var, and it's the same in main and other threads. Below is my code sample. int pause_flag; int initThread() { int err; err = pthread_create(&user_request_thread, NULL, (void *)&user_request_handler, NULL); if (e (HowTos)