Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

general_mutex

The general_mutex rust crate is a generalized mutex trait that can be used for templating. This allows a struct to have templated mutex types for its internal variables:

struct MyStruct<MutexType>
where
    MutexType: general_mutex::Mutex<Data = usize>,
{
    // Internal variable containing a templated mutex with a usize in it
    lock: MutexType,
}

A struct can then be created with any of the provided mutex types

// Using the type provided by the crate...
let my_struct1: MyStruct<spin::Mutex<_>> = MyStruct::new();

// ... Or just the mutex as-is
let my_struct2: MyStruct<spin::Mutex<core::cell::RefCell<_>>> = MyStruct::new();

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages