5 years, 1 month ago.

How to access class variables of thread

I have a thread that I spawn that populates some variables of a class. I then want to access those variables outside of the thread at various times. I have tried a mutex lock(makes sense to me) around the access to the class variables outside of the thread, but the program will still halt execution as soon as anything tries to access the variables outside of the thread.

Is there anything I am missing?


Question relating to:

Be the first to answer this question.