# “ThreadStaticVariable” (Problem)

What will the following code display?

```csharp
[ThreadStatic]
static readonly int Foo = 42;

void Main()
{
  var thread = new Thread(() => Console.WriteLine(Foo));
  thread.Start();
  thread.Join();
}
```

[Solution](https://andreyakinshin.gitbook.io/problembookdotnet/en/multithreading/threadstaticvariable-s)
