mardi 24 novembre 2015

std::timed_mutex::try_lock* fail spuriously

By try_lock*, I take to mean try_lock(), try_lock_for(), and try_lock_until(). According to cppreference, all three methods may just fail spuriously. Following is quoted from the description for try_lock_for()

As with try_lock(), this function is allowed to fail spuriously and return false even if the mutex was not locked by any other thread at some point during timeout_duration.

I know that spurious wakeup may happen with std::condition_variable and the rationale behind it. But, what is the case with a mutex?

Aucun commentaire:

Enregistrer un commentaire