Make JitCodeDebugInfoEntryHandleInner Send and Sync

This commit is contained in:
Mark McCaskey
2020-02-21 14:52:28 -08:00
parent 40e4dddc4b
commit d7fca539c1

View File

@ -139,6 +139,12 @@ unsafe fn remove_node(jce: *mut JitCodeEntry) {
#[derive(Debug)] #[derive(Debug)]
struct JitCodeDebugInfoEntryHandleInner(*mut JitCodeEntry); struct JitCodeDebugInfoEntryHandleInner(*mut JitCodeEntry);
// this is safe because the pointer is never mutated directly and then
// [`JIT_DEBUG_DESCRIPTOR_LOCK`] should always be held whenever any mutation
// can happen.
unsafe impl Send for JitCodeDebugInfoEntryHandleInner {}
unsafe impl Sync for JitCodeDebugInfoEntryHandleInner {}
/// Handle to debug info about JIT code registered with a debugger /// Handle to debug info about JIT code registered with a debugger
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub(crate) struct JitCodeDebugInfoEntryHandle(Arc<JitCodeDebugInfoEntryHandleInner>); pub(crate) struct JitCodeDebugInfoEntryHandle(Arc<JitCodeDebugInfoEntryHandleInner>);