Ok, I have fairly little multi-threading experience, but i have done a similar thing before without issue...but this has me stumped.
This is in C++, Directx9 Visual Studio...
My game basically runs in one thread, apart from loading screens. When I want to load a new game, I fire up a new thread which goes through and does all of the simulation and asset loading stuff. Meanwhile, the original (base) thread displays an animated loading screen. Once the loading is finished, the loading thread sets a flag in tjhe loading screen saying it's done, and during the loading screens Draw() it spots the flag, ends the 'loading' thread, and starts the main game.
All of this works perfectly, in debug and release.
For some reason, if I run the game in fullscreen mode, it goes wrong. The game hangs at the end of loading, and it looks like the flag in the loading screen is never getting set. if I force a debug break into the base thread, it seems to always be inside the D3D flip().
I can't see what I'm doing wrong. The loading thread does zero rendering. It creates some directx assets but never uses them. The flag I'm using to communicate between threads is a simple int, and it's read/write should thus be atomic. I've done a very similar thing in my previous games with no problems, but this has me stumped. Should I really be using CriticalSections etc for something this simple? Help!