Of course you can set a static variable in a thread, but think if it makes any sense or not. But if a variable is static, it can be accessed by some other thread. If it is not, there is no a problem (there is a potential problem), but then, there is no need to make an object static. So, if it is static, you can do this:
static internal int VariableNotInTheThread = 0;
static internal object LockObject = new object();
public void ReloadChunks()
{
lock (LockObject)
VariableNotInTheThread = 1;
}
So, if you use anything across threads, you should synchronize it; in this case, with the lock. Static objects are evil, as a rule of thumb.
However,
this is a bad technique which should rarely be used. For one of good techniques, please see my answers where I introduced the very useful thread wrapper which, in particular, allows you to share objects in an encapsulated way, and avoid static objects:
How to pass ref parameter to the thread[
^],
change paramters of thread (producer) after it started[
^] (this one with lock).
—SA