diff options
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | Changelog.org | 7 | ||||
-rw-r--r-- | src/lib.rs | 3 |
3 files changed, 8 insertions, 4 deletions
@@ -1,7 +1,7 @@ [package] name = "starb" description = "STAtic Ring Buffers." -version = "0.2.0" +version = "0.3.0" authors = ["Brian Cully <bjc@kublai.com>"] edition = "2018" license = "LGPL-3.0-or-later" diff --git a/Changelog.org b/Changelog.org index 93327cc..74c731f 100644 --- a/Changelog.org +++ b/Changelog.org @@ -1,5 +1,10 @@ -* Since 0.1 +* Since 0.2 + - API CHANGE: The `Reader` and `Writer` types were inadvertently + marked `Sync` when they are not. While you may read and write from + separate threads safely, it is neither safe to read from two + threads or more threads nor write from two or more threads. +* Since 0.1 - API CHANGE: `RingBuffer::new()` no longer takes an argument. - `Copy` trait is no longer required on most `RingBuffer` methods. - Added two methods for bulk copying data in/out of the ring buffer: @@ -73,6 +73,7 @@ impl<T> RingBuffer<T> { (rbr, rbw) } } +unsafe impl<T> Send for RingBuffer<T> where T: Send {} /// Consumer of `RingBuffer`. pub struct Reader<'a, T> { @@ -80,7 +81,6 @@ pub struct Reader<'a, T> { _marker: PhantomData<&'a ()>, } unsafe impl<T> Send for Reader<'_, T> where T: Send {} -unsafe impl<T> Sync for Reader<'_, T> {} /// Producer for `Ringbuffer`. pub struct Writer<'a, T> { @@ -88,7 +88,6 @@ pub struct Writer<'a, T> { _marker: PhantomData<&'a ()>, } unsafe impl<T> Send for Writer<'_, T> where T: Send {} -unsafe impl<T> Sync for Writer<'_, T> {} impl<T> Reader<'_, T> { /// The number of elements currently available for reading. |