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 255243c16a
commit 857ed8609c

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());