Discussion:
CCriticalSection as extern
(too old to reply)
Todor Atanasov
2013-06-17 04:23:17 UTC
Permalink
Hy Everyone,
I have two threads calling two different classes.
I have defined two CArrays as extern so both classes can access them. I have also created two CCriticalSection as extern to lock each array during write/read in the two classes.
Is this a correct way to do things?
ScottMcP [MVP]
2013-06-17 16:45:56 UTC
Permalink
Post by Todor Atanasov
Hy Everyone,
I have two threads calling two different classes.
I have defined two CArrays as extern so both classes can access them. I have also created two CCriticalSection as extern to lock each array during write/read in the two classes.
Is this a correct way to do things?
You should be OK if each thread locks only one CCriticalSection at a time. If a thread locks two of them you have the potential for a deadlock.
Todor Atanasov
2013-06-17 19:50:05 UTC
Permalink
Thanks for the fast reply!

Loading...