749 Commits

Author SHA1 Message Date
Noah cd32d2f104 Remove the RawRwLock::is_locked_{shared,exclusive} differentiation 2020-05-18 14:29:11 -05:00
Noah 6f66eefe93 Add [Raw]RwLock::is_locked() 2020-05-18 13:42:13 -05:00
Noah c97d552cca Add ReentrantMutex::is_locked() 2020-05-18 13:41:45 -05:00
Noah b12d1e88d7 Add Mutex::is_locked() 2020-05-18 13:40:51 -05:00
Noah 55cc8983ba Add RawMutex::is_locked() 2020-05-18 11:32:24 -05:00
Amanieu d'Antras addfc15a71 Merge pull request #231 from azriel91/feature/use-wasm-compatible-instant 2020-05-16 00:42:13 +01:00
Azriel Hoh 1aab4f01d8 Uses instant::Instant in place of std::time::Instant. 2020-05-15 17:15:54 +12:00
Amanieu d'Antras d37ba9b81c Merge pull request #230 from XAMPPRocky/patch-1 2020-05-11 01:33:07 +01:00
XAMPPRocky 2161072483 Use GitHub badge 2020-05-10 16:43:41 +02:00
Amanieu d'Antras 2a152b404a Merge pull request #229 from XAMPPRocky/master 2020-05-10 15:40:48 +01:00
XAMPPRocky 70d6fc0c93 Update bors.toml 2020-05-10 16:39:54 +02:00
XAMPPRocky e3d9bad806 Delete .travis.yml 2020-05-10 13:55:49 +02:00
XAMPPRocky 8d342339ef Delete appveyor.yml 2020-05-10 13:55:39 +02:00
XAMPPRocky 022494ccf0 Exclude deadlock_detection from 1.36.0 2020-05-10 13:42:28 +02:00
XAMPPRocky 65daa45320 Add GitHub Actions CI 2020-05-10 11:02:11 +02:00
Amanieu d'Antras 339d28ba51 Merge pull request #227 from d3lm/master
Update readme and fix typo
2020-04-22 09:32:32 +01:00
Dominic Elm 96c61630c1 Update readme and fix typo 2020-04-22 08:32:18 +02:00
Amanieu d'Antras 08a1542e0b Bump parking_lot_core version to 0.7.2 2020-04-21 23:07:16 +01:00
bors[bot] 6f35e469f2 Merge #226
226: Replace Instant with dummy on wasm32-unknown-unknown r=Amanieu a=d3lm



Co-authored-by: Dominic Elm <elmdominic@gmx.net>
2020-04-21 14:59:20 +00:00
Dominic Elm d195e8233f Replace Instant with dummy on wasm32-unknown-unknown 2020-04-21 16:57:15 +02:00
Amanieu d'Antras 0489b32a88 Bump parking_lot to version 0.10.2 2020-04-10 23:04:59 +01:00
bors[bot] 51559fe3d4 Merge #224
224: Fix required lock_api version r=Amanieu a=palana

As of https://github.com/Amanieu/parking_lot/commit/7cd296b0dea36cb14d49a754723110573ec26c84 the additions to lock_api in https://github.com/Amanieu/parking_lot/commit/976c0c184b7a1116c9ec29e99d70f2834d7f4885 are required to build parking_lot; building with lock_api 0.3.{1,2,3} fails due to missing `_::const_new` functions

Co-authored-by: Palana <palana@stunned.de>
2020-04-10 20:17:46 +00:00
Palana 86fa79e30d Update required parking_lot_core version 2020-04-10 22:13:52 +02:00
Palana 79c92a3efa Fix required lock_api version
As of https://github.com/Amanieu/parking_lot/commit/7cd296b0dea36cb14d49a754723110573ec26c84
the additions to lock_api in https://github.com/Amanieu/parking_lot/commit/976c0c184b7a1116c9ec29e99d70f2834d7f4885
are required to build parking_lot; building with lock_api 0.3.{1,2,3}
fails due to missing `_::const_new` functions
2020-04-10 21:26:08 +02:00
Amanieu d'Antras 6a0c54315f Add test for #203 2020-04-10 17:20:10 +01:00
Amanieu d'Antras 29aef53a32 Bump versions of all crates 2020-04-10 17:17:06 +01:00
bors[bot] c0bf543ef0 Merge #223
223: Use llvm_asm! instead of asm! r=Amanieu a=Amanieu

`asm!` will be deprecated soon in preparation for the new `asm!` macro, so switch to using `llvm_asm!` instead.

cc https://github.com/rust-lang/rfcs/pull/2843

Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
2020-04-09 22:57:32 +00:00
Amanieu d'Antras 60bbd9de1e Attempt to fix CI 2020-04-09 23:56:41 +01:00
Amanieu d'Antras c2d063897c Fix documentation link
Fixes #222
2020-04-09 22:11:45 +01:00
Amanieu d'Antras 826128f8e8 Use llvm_asm! instead of asm! 2020-04-06 21:31:19 +01:00
bors[bot] 1d867a586a Merge #219
219: Remove the lazy_static dependency r=Amanieu a=CryZe

I noticed there's a few things I missed in my previous PR.

1. lazy_static is not necessary anymore. We can just use the new const constructor functions instead.
2. The README still mentions lazy_static.

Co-authored-by: Christopher Serr <christopher.serr@gmail.com>
2020-02-19 14:09:28 +00:00
Christopher Serr 825287d600 Remove the lazy_static dependency
It is not necessary anymore. We can initialize the Mutex at compile
time.
2020-02-19 13:05:01 +01:00
bors[bot] 8eecdc448d Merge #217
217: Implement Support for creating the locking primitives in a const context on stable Rust r=Amanieu a=CryZe

This adds a new constructor `const_new` to lock_api's mutexes, reentrant mutexes and RwLocks that allows creating them in a constant context on stable Rust by manually passing in the underlying raw mutex / rwlock.

Additionally, various helper functions are being added to parking_lot that allow creating mutexes, reentrant mutexes, fair mutexes and RwLocks in constant contexts on stable Rust.

Co-authored-by: Christopher Serr <christopher.serr@gmail.com>
2020-02-19 10:32:32 +00:00
Christopher Serr d5105c43a1 Address the review comments
This splits the doc comments into multiple paragraphs and renames the
helpers to create the locking primitives to `const_*` instead of
`new_*`.
2020-02-19 11:29:13 +01:00
Christopher Serr 7cd296b0de Add convenience const constructors to parking_lot
This adds various helper functions to `parking_lot` that allow creating
parking_lot's mutexes, reentrant mutexes, fair mutexes and RwLocks in
constant contexts on stable Rust.
2020-02-18 10:43:27 +01:00
Christopher Serr 976c0c184b Add new const_new function to lock_api
This new constructor allows creating mutexes, reentrant mutexes and
RwLocks in a constant context on stable Rust by manually passing in the
underlying raw mutex / rwlock.
2020-02-18 10:38:33 +01:00
bors[bot] 0194bba7af Merge #210
210: Synchronize on compare_exchange failure in create_hashtable r=Amanieu a=tmiasko



Co-authored-by: Tomasz Miąsko <tomasz.miasko@gmail.com>
2020-01-22 16:14:42 +00:00
Tomasz Miąsko b1842a8b2c Synchronize on compare_exchange failure in create_hashtable 2020-01-22 00:00:00 +00:00
Amanieu d'Antras df824f1897 Merge pull request #207 from Tankobot/master
Fix documentation and example for `try_lock`
2020-01-18 13:20:00 +00:00
Michael Bradley f5fa272804 Fix try_lock implementation in lock_api example 2020-01-17 21:22:59 -08:00
Michael Bradley a65cdf183b Add documentation for try_lock return 2020-01-17 21:22:59 -08:00
Amanieu d'Antras d5ee821c69 Merge pull request #209 from cuviper/petgraph-0.5
Upgrade petgraph to 0.5
2020-01-17 10:16:32 +00:00
Josh Stone d0181b7c28 Upgrade petgraph to 0.5 2020-01-16 13:21:44 -08:00
bors[bot] 9195c29627 Merge #208
208: Fixed comment typo. "and" -> "an" r=faern a=RandomInsano



Co-authored-by: Edwin Amsler <EdwinGuy@GMail.com>
2020-01-13 07:53:50 +00:00
Edwin Amsler cc72f5ac4f Fixed comment typo. "and" -> "an" 2020-01-12 23:58:48 -06:00
bors[bot] a3886d6e3a Merge #204
204: Create API for mutex that is always fair r=Amanieu a=paulocsanz

Fixes #76. I don't know if there is interest in having a API for a Mutex that is always fair, but solving it at the type level seems better than requiring a state for each mutex. Fairness sometimes is required, so making type level assurances so another dev can't screw up may solve a bunch of problems, it's probably already being done by people that need it since it's just a thin wrapper. 

This implements a `FairMutex` and it's `RawFairMutex`. This could be done for RwLock too if there is interest.

Idk if the tests are required since it's literally calling something already tested, but I just copied the files and made it compile. I had to remove the Condvar test, since Condvar assumes it's a MutexGuard, and doesn't accept a FairMutexGuard.

Co-authored-by: Paulo <paulosanz@poli.ufrj.br>
2020-01-09 23:53:53 +00:00
Amanieu d'Antras 77d3e1c126 Add test and comment for #203 2020-01-09 23:51:14 +00:00
bors[bot] c21f598673 Merge #203
203: fix: not panic in destructor r=Amanieu a=zhangli-pear

`release_resource` should not panic. Because `with_thread_data` may return a `ThreadData` on the stack, and it's empty.



Co-authored-by: zhangli.pear <zhangli.pear@bytedance.com>
2020-01-09 23:17:46 +00:00
Paulo 2cd3d6ac82 Update docs 2020-01-07 12:49:20 -03:00
Paulo d62ea11280 Update FairMutex docs 2020-01-07 12:37:19 -03:00