Skip to content

Releases: botahamec/happylock

v0.2

24 May 01:05
Compare
Choose a tag to compare

A big update which utilizes cyclic wait prevention for better performance. Also, the Sharable API is here.

Breaking Changes

  • LockCollection has been replaced with four different lock collection types. A sensible default is still aliased as LockCollection
  • The Lockable trait has been removed, and replaced with two new traits: a new trait sharing the same name (Lockable), and RawLock
  • OwnedLockable no longer has a lifetime. Why did I ever give it one?
  • Lockable and OwnedLockable are no longer top-level exports. They're hidden in the lockable module now.
  • Mutex::get_mut and RwLock::get_mut have been removed. Use as_mut instead.
  • A few methods are now must_use

Minor Changes

  • Updated documentation and examples
  • ReadLock and WriteLock are now repr(transparent)
  • unsafe fn RwLock::raw()
  • unsafe fn Mutex::raw()
  • impl<...> Default for Mutex<T, R>
  • impl<...> Default for RwLock<T, R>
  • impl<...> Debug for MutexRef<'a, T, R>
  • impl<...> Display for MutexRef<'a, T, R>
  • impl<...> Debug for MutexGuard<'a, 'key, T, Key, R>
  • impl<...> Display for MutexGuard<'a, 'key, T, Key, R>
  • impl<...> Debug for RwLockReadRef<'a, T, R>
  • impl<...> Display for RwLockReadRef<'a, T, R>
  • impl<...> Debug for RwLockReadGuard<'a, 'key, T, Key, R>
  • impl<...> Display for RwLockReadGuard<'a, 'key, T, Key, R>
  • impl<...> AsRef<T> for MutexRef<'a, T, R>
  • impl<...> AsMut<T> for MutexRef<'a, T, R>
  • impl<...> AsRef<T> for MutexGuard<'a, 'key, T, Key, R>
  • impl<...> AsMut<T> for MutexGuard<'a, 'key, T, Key, R>
  • impl<...> AsRef<T> for RwLockReadRef<'a, T, R>
  • impl<...> AsRef<T> for RwLockReadGuard<'a, 'key, T, Key, R>
  • impl<...> AsRef<T> for RwLockWriteRef<'a, T, R>
  • impl<...> AsMut<T> for RwLockWriteRef<'a, T, R>
  • impl<...> AsRef<T> for RwLockWriteGuard<'a, 'key, T, Key, R>
  • impl<...> AsMut<T> for RwLockWriteGuard<'a, 'key, T, Key, R>

Bug fixes

  • The Debug format for WriteLock no longer says ReadLock

Full Changelog: v0.1.5...v0.2

v0.1.5

15 Mar 16:31
Compare
Choose a tag to compare

Changelog:

  • Reverts a buggy change made in v0.1.2 which caused bugs
  • Adds std::thread::yield to Lockable implementations to prevent spinlock behavior

v0.1.2

14 Mar 02:00
Compare
Choose a tag to compare

I made some performance improvements that didn't require breaking changes:

  • LockCollection<[T; N]>, LockCollection<Box<[T]>> and LockCollection<Vec<T>> now behave less like spinlocks when their first element isn't locked
  • Added notes for how LockCollection should be used with tuples
  • Sorted the list of pointers in try_new before doing the comparison

v0.1.1

12 Mar 15:23
Compare
Choose a tag to compare

Fixed some trait bounds issues