12-27-2016, 05:50 AM
I would use a global variable like in your code.
Could use a local variable and pass its address, but it is dangerous, because the first thread may exit first.
In C++ could use a reference-counted variable with InterlockedIncrement/InterlockedDecrement, but in QM it is difficult.
Could use a local variable and pass its address, but it is dangerous, because the first thread may exit first.
In C++ could use a reference-counted variable with InterlockedIncrement/InterlockedDecrement, but in QM it is difficult.