I have the following code and I was wondering if someone could look at it for me.
I have a multi-threaded application that all share an object and operate on it. I've created a pointer to a certain element of it, just so I don't have to type in the long path every time, but I'm concerned it might simply be modifying a copy of the shared object, rather than the shared object itself.
Here is the code:
RPCThread* thr = &(args->s->_shared-_>rpcThread[args->threadIndex]);
...
thr->_in_use = true;
...
sema_post(&(thr->_sem_result));
Is this valid or would this just be modifying a copy?