Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
7 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
## `ref_mutex` Rust library | ||
|
||
**My code seems erroneous!** Don't use. | ||
Please instead use `Mutex<send_cell::Ref<T>>` (https://docs.rs/send-cell/). | ||
|
||
_Not much tested._ | ||
--- | ||
|
||
This library implement `RefMutex<T>` that is similar to `Mutex<T>` but is `Sync` and `Send` | ||
even if `T` isn't `Send`. | ||
|
||
TODO: It seems this can be instead be done as a patch to standard library: | ||
**My code is erroneous!** Don't use. | ||
|
||
```rust | ||
unsafe impl<'mutex, T: ?Sized + Sync> Sync for Mutex<'mutex, T> {} | ||
unsafe impl<'mutex, T: ?Sized> Send for Mutex<'mutex, T> { } | ||
``` | ||
This library implement `RefMutex<T>` that is similar to `Mutex<T>` but is `Sync` and `Send` | ||
even if `T` isn't `Send`. |