]> git.nihav.org Git - nihav.git/commitdiff
core/refs: make NABufferRef suitable for passing buffers to threads
authorKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 22 Nov 2019 11:57:26 +0000 (12:57 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 22 Nov 2019 11:57:26 +0000 (12:57 +0100)
nihav-core/src/refs.rs

index 4c2e2903a0f3e11b4a02a093f93d158398ff6656..292c8887d4cf376c3413d0faf42e37e10cd10d6c 100644 (file)
@@ -35,6 +35,9 @@ pub struct NABufferRef<T> {
     ptr: *mut NABufferData<T>,
 }
 
+unsafe impl<T> Sync for NABufferRef<T> {}
+unsafe impl<T> Send for NABufferRef<T> {}
+
 impl<T> NABufferRef<T> {
     pub fn new(val: T) -> Self {
         let bdata = NABufferData::new(val);