Skip to main content

dr_mark_safe_to_suspend

Function dr_mark_safe_to_suspend 

Source
pub unsafe extern "C" fn dr_mark_safe_to_suspend(
    drcontext: *mut c_void,
    enter: bool_,
) -> bool_
Expand description

Use this function to mark a region of code as safe for DR to suspend the client while inside the region. DR will not relocate the client from the region and will resume it at precisely the suspend point.

This function must be used in client code that acquires application locks. Use this feature with care! Do not mark code as safe to suspend that has a code cache return point. I.e., do not call this routine from a clean call. For acquiring application locks from a clean call, see dr_app_recurlock_lock().

No DR locks can be held while in a safe region. Consequently, do not call this routine from any DR event callback. It may only be used from natively executing code.

Always invoke this routine in pairs, with the first passing true for \p enter and the second passing false, thus delimiting the region.