C# Language Making a variable thread safe