Structure is Sync, and StructureRef is Send+Sync

This commit is contained in:
Sebastian Dröge 2018-09-22 11:00:17 +03:00
parent c21f98d2c3
commit d317e15c2e

View file

@ -29,6 +29,7 @@ use gobject_ffi;
pub struct Structure(ptr::NonNull<StructureRef>, PhantomData<StructureRef>);
unsafe impl Send for Structure {}
unsafe impl Sync for Structure {}
impl Structure {
pub fn builder(name: &str) -> Builder {
@ -295,6 +296,9 @@ impl GlibPtrDefault for Structure {
#[repr(C)]
pub struct StructureRef(ffi::GstStructure);
unsafe impl Send for StructureRef {}
unsafe impl Sync for StructureRef {}
impl StructureRef {
pub unsafe fn from_glib_borrow<'a>(ptr: *const ffi::GstStructure) -> &'a StructureRef {
assert!(!ptr.is_null());