I assume you need to pass some value(s) when the thread is already running which is one of the most general cases of thread synchronization.
Share the variable between threads. Make the variable visible by both threads: the one you send the value and the one using the value. Also, create an instance or
Critical Section
using
InitializeCriticalSection
, make it visible by two threads. Create two function: one assigning the value to the variable, another one to read this value. Sandwich the code reading the variable and assignment with
EnterCriticalSection
and
LeaveCriticalSection
.
This way you make access to the variable
thread-safe. See
http://msdn.microsoft.com/en-us/library/ms682530%28v=vs.85%29.aspx[
^].
—SA