Skip to content

Race condition when loading CVars in threaded onLoad #94

Description

@dster2

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions