I think I found a race condition bug when using PLUGINTYPE_THREADED (run onLoad in its own thread) with loading CVars. I'm defining my cvars in onLoad as usual, and sometimes I'd actually get the values saved in config.cfg, but more often they'd just take the default values. Removing PLUGINTYPE_THREADED fixes this bug, so I assume there's a race condition between my onLoad thread and the code that reads the saved values. Or is this WAI and I'm supposed to define my cvars differently?
I've uploaded a simple repro plugin here though YMMV since it seems to be a race condition...
I think I found a race condition bug when using
PLUGINTYPE_THREADED(runonLoadin its own thread) with loading CVars. I'm defining my cvars inonLoadas usual, and sometimes I'd actually get the values saved inconfig.cfg, but more often they'd just take the default values. RemovingPLUGINTYPE_THREADEDfixes this bug, so I assume there's a race condition between myonLoadthread and the code that reads the saved values. Or is this WAI and I'm supposed to define my cvars differently?I've uploaded a simple repro plugin here though YMMV since it seems to be a race condition...