I need two modify two class members (the same class instance) by 2 threads, each of the thread will access a different member variable, the two threads will never access the same member variable. I found a page that talks about this issue:
https://www.securecoding.cert.org/confluence/display/seccode/POS49-C.+When+data+must+be+accessed+by+multiple+threads,+provide+a+mutex+and+guarantee+no+adjacent+data+is+also+accessed
Is this true for C++ and classes, do i need to lock the entire class (use one critical section to lock the entire class), can i use different critical sections to lock each of the variables (each member has it's own critical section)?
