threadvar and initialization lazarus / 21-General ---------------------------------------------------------------------- ginoo · 2024-09-28 07:45 Hello, I have a question that I hope makes sense. Is there a system to initialize a threadvar as is done with a normal variable with “initialization” ---------------------------------------------------------------------- Thaddy · 2024-09-28 10:39 Threadvars can indeed not be initialized at declaratiion time or initialization section. The compiler will throw an error if you try that. Threadvars need to be initialized in their own thread context and that must be a code block, not a declaration block. Usually a constructor. ---------------------------------------------------------------------- ginoo · 2024-09-28 13:48 O, thank you for responding. I imagined that was the case, however, I was hoping there was also some other solution.