I implemented boost upgradable mutexes following the top answer here Example of how to use boost upgradeable mutexes
What I would like to do is to "try" whether or not the upgrade will block: if the upgrade will not block performs the upgrade, otherwise don't lock it and returns.
Is there any function to do so?
Yes there is :
-bool try_lock_upgrade_for(duration d)
-bool try_lock_upgrade_until(time when)