BGPierce / VCC

Tandy Color Computer 3 Emulator
GNU General Public License v3.0
0 stars 0 forks source link

volatile qualify FlagEmuStop #9

Open jejones3141 opened 8 years ago

jejones3141 commented 8 years ago

I believe that the declaration of FlagEmuStop should be changed to

static volatile unsigned char FlagEmuStop=TH_RUNNING; because as it is, a compiler is free to change the loop

 FlagEmuStop=TH_WAITING; //Signal Main thread we are waiting
 while(FlagEmuStop==TH_WAITING)
      Sleep(1);

in EmuLoop() to

FlagEmuStop = TH_WAITING;
for (;;)
    Sleep(1);

since FlagEmuStop is static and its address is never passed outside Vcc.c.

I've been running Vcc on Linux using WINE, and I find that selecting exit doesn't close the Vcc window. I can't swear that this is the cause of the problem, but it could be. I don't use Windows (save under duress), and Visual Studio is in the "garbage" category at winehq, so I can't make the change locally and rebuild to test; sorry about that.

ursine commented 8 years ago

Thanks for the input. Things are at a bit of a lull at the moment, but one of us will take a look at it during the next burst of development.