MCQs > IT & Programming > C++ > What is the main difference between these two Functions? std::mutex::lock() Std::mutex::try_lock()

C++ MCQs

What is the main difference between these two Functions? std::mutex::lock() Std::mutex::try_lock()

Answer

Correct Answer: Both attempt to acquire a lock, but lock() blocks if the mutex is not available, whereas try_lock() returns whether the mutex is available or not.

Explanation:

Note: This Question is unanswered, help us to find answer for this one

C++ Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

C++ Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it