For example i have a class mutex :
In function Test(), is a will be safely return? i mean will the method got the a value before the mutex destroyed?Code:class Mutex { pthread_mutex_t & mMutex; public: Mutex(pthread_mutex_t & m):mMutex(m) { pthread_mutex_lock(&mMutex); } ~Mutex() { pthread_mutex_unlock(&mMutex); } }; public void Test(){ Mutex(mx); return a; }
Thanks