I have two functions
void myclass::func()
{
std::shared_lock<std::mutex>(m_mutex);
func1();
}
void myclass::func2()
{
std::shared_lock<std::mutex>(m_mutex);
}
is it right way to using mutex ? or it will cause any problem ? I have lots of function which are doing reading/writing but they are also calling in each other frequently. how should I implement this scenario ?
I am using c++11 for mutex.
Aucun commentaire:
Enregistrer un commentaire