
27 Mar
2014
27 Mar
'14
8:21 a.m.
Hi, this is my first post here so please bare with me :) . I recently used upgrade_lock to try access a shared resource from 2 different threads. I noticed that once the first thread acquired its upgrade_lock the second thread was blacked until the first thread unlock it. can someone please explain me the logic behind this behavior? isn't an upgrade lock just a shared_lock that can be upgraded to unique_lock? why not let both threads acquire it just like shared_lock until, and if, they decide to upgrade it to unique_lock? Thanks a lot, Elad.