1. A method, comprising: performing by a computer: beginning execution of a multithreaded application; while executing the application, a thread of the application encountering a critical section of code in the application that is associated with a lock, wherein when the lock is held by a thread, other threads are prevented from entering the critical section; determining a context in which the critical section was encountered; determining a policy that is applicable to the determined context, wherein the policy is usable in determining which of a plurality of integrated mechanisms for executing the critical section without acquiring the lock is to be employed in attempting to execute the critical section; selecting one of the plurality of integrated mechanisms, dependent on the determined policy; and the thread attempting to execute the critical section using the selected one of the plurality of integrated mechanisms.