pub unsafe extern "C" fn dr_app_recurlock_lock(
reclock: *mut c_void,
mc: *mut dr_mcontext_t,
)Expand description
Acquires \p reclock, or increments the ownership count if already owned. Calls to this method which block (i.e. when the lock is already held) are marked safe to suspend AND transfer; in that case the provided mcontext \p mc will overwrite the current thread’s mcontext. \p mc must have a valid PC and its flags must be DR_MC_ALL.
This routine must be used in clients holding application locks to prevent deadlocks in a way similar to dr_mark_safe_to_suspend(), but this routine is intended to be called by a clean call and may return execution to the provided mcontext rather than returning normally.
If this routine is called from a clean call, callers should not return normally. Instead, dr_redirect_execution() or dr_redirect_native_target() should be called to to prevent a return into a flushed code page.