impl `Sync` for `ID`

While we may be treating the representation of this type as opaque, I
think we can reasonably assume that it will never change to anything
that isn't `Sync`.

I think it may be worth considering making `VALUE` be `Sync` as well.
Even though it is effectively a pointer, it's a pointer to a *Ruby*
object, and therefore subject to the GVL.
This commit is contained in:
Sean Griffin 2017-11-08 10:41:20 -07:00
parent 4216a3a758
commit 8b97e143ff
1 changed files with 2 additions and 0 deletions

View File

@ -25,6 +25,8 @@ pub type c_string = *const libc::c_char;
#[derive(Eq, PartialEq, Hash, Copy, Clone, Debug)]
pub struct ID(*mut void);
unsafe impl Sync for ID {}
#[repr(C)]
#[derive(Eq, PartialEq, Copy, Clone, Debug)]
pub struct VALUE(*mut void);