Commit Graph

138 Commits

Author SHA1 Message Date
John Nunley 542831132f
Replace async-channel with flume
This commit replaces async-channel in some tests with flume. It appears
that async-channel doesn't work under MIRI but flume does, so we can
work around this for now by replacing it with flume.

cc https://github.com/smol-rs/async-channel/issues/85

Signed-off-by: John Nunley <dev@notgull.net>
2024-04-08 14:10:39 -07:00
John Nunley df82e5bb5e chore: Silence clippy
Signed-off-by: John Nunley <dev@notgull.net>
2024-04-08 11:01:15 -07:00
Taiki Endo aeb9d8ff8e Remove redundant import
```
error: the item `Future` is imported redundantly
  --> tests/rwlock.rs:11:5
   |
9  | use futures_lite::prelude::*;
   |     ------------------------ the item `Future` is already imported here
10 | #[cfg(not(target_family = "wasm"))]
11 | use std::future::Future;
   |     ^^^^^^^^^^^^^^^^^^^
   |
   = note: `-D unused-imports` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unused_imports)]`
```
2024-03-03 12:43:35 -05:00
John Nunley ff4c96fe4d
m: Port to event-listener v5.0.0
cc smol-rs/event-listener#105

Signed-off-by: John Nunley <dev@notgull.net>
2024-02-12 06:27:42 -08:00
John Nunley 47dd439e5a
v3.3.0
Signed-off-by: John Nunley <dev@notgull.net>
2024-01-09 20:53:09 -08:00
Taiki Endo 6581d8b655 Use cfg(target_family = "wasm") in Cargo.toml 2024-01-07 03:46:47 +09:00
Taiki Endo 0493551beb Migrate to Rust 2021 2024-01-07 03:46:47 +09:00
Taiki Endo 0c262ea908 Bump MSRV to 1.60
https://github.com/crossbeam-rs/crossbeam/pull/1056
2024-01-07 03:46:47 +09:00
Taiki Endo 83d8a2771e ci: Use cargo-hack's --rust-version flag for msrv check
This respects rust-version field in Cargo.toml, so it removes the need
to manage MSRV in both the CI file and Cargo.toml.
2024-01-07 03:46:47 +09:00
Harry Barber 3e855f55f0
feat: add `forget` method to semaphore guards (#73)
Co-authored-by: Jules Bertholet <julesbertholet@quoi.xyz>
2023-12-11 00:29:25 -05:00
John Nunley 37ccc919e7
v3.2.0
Signed-off-by: John Nunley <dev@notgull.net>
2023-12-02 11:09:26 -08:00
Jules Bertholet d1cff639d8
Add missing `Arc` blocking methods (#71)
* Add missing `Arc` blocking methods

Adds:

- `Rwlock::read_arc_blocking`
- `RwLock::upgradable_read_arc_blocking`
- `RwLock::write_arc_blocking`
- `RwLockUpgradableReadGuardArc::upgrade_blocking`
- `Semaphore::acquire_arc_blocking`

* Restore missing future `fmt::Debug` impls
2023-11-25 22:19:13 -05:00
John Nunley 751c7b8421
v3.1.2
Signed-off-by: John Nunley <dev@notgull.net>
2023-11-24 07:51:41 -08:00
dependabot[bot] d333a41c1d
Update event-listener requirement from 3.0.0 to 4.0.0 (#69)
* Update event-listener requirement from 3.0.0 to 4.0.0

Updates the requirements on [event-listener](https://github.com/smol-rs/event-listener) to permit the latest version.
- [Release notes](https://github.com/smol-rs/event-listener/releases)
- [Changelog](https://github.com/smol-rs/event-listener/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/event-listener/compare/v3.0.0...v4.0.0)

---
updated-dependencies:
- dependency-name: event-listener
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update `event-listener-strategy` to 0.4.0

* Adjust `EventListener::new` and `listen` calls

* Appease rustc 173b950

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jules Bertholet <julesbertholet@quoi.xyz>
2023-11-21 00:54:32 -05:00
John Nunley 9c7f6effd9
v3.1.1
Signed-off-by: John Nunley <dev@notgull.net>
2023-11-19 09:36:36 -08:00
Jules Bertholet b9aa29483f Fix broken links in docs 2023-11-16 18:41:27 -08:00
Jules Bertholet 780e86ba97 Check docs in CI 2023-11-16 18:41:27 -08:00
John Nunley 48c091ef3b
docs: Add a note comparing against std types
Signed-off-by: John Nunley <dev@notgull.net>
Co-authored-by: Jules Bertholet <julesbertholet@quoi.xyz>
2023-11-13 18:42:26 -08:00
John Nunley 2d0c2edf0a
v3.1.0
Signed-off-by: John Nunley <dev@notgull.net>
2023-11-12 16:17:31 -08:00
Jules Bertholet 902e8f9229
Implement `Default` for `OnceCell` (#63) 2023-11-08 11:01:15 -05:00
dependabot[bot] 33d64af64a
Update futures-lite requirement from 1.12.0 to 2.0.0 (#61)
Updates the requirements on [futures-lite](https://github.com/smol-rs/futures-lite) to permit the latest version.
- [Release notes](https://github.com/smol-rs/futures-lite/releases)
- [Changelog](https://github.com/smol-rs/futures-lite/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/futures-lite/compare/v1.12.0...v2.0.0)

---
updated-dependencies:
- dependency-name: futures-lite
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-29 21:34:43 -04:00
dependabot[bot] 783afb6984
Update async-channel requirement from 1.5.0 to 2.0.0 (#60)
Updates the requirements on [async-channel](https://github.com/smol-rs/async-channel) to permit the latest version.
- [Release notes](https://github.com/smol-rs/async-channel/releases)
- [Changelog](https://github.com/smol-rs/async-channel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/async-channel/compare/v1.5.0...v2.0.0)

---
updated-dependencies:
- dependency-name: async-channel
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-29 21:34:22 -04:00
John Nunley 8603347eb2
v3.0.0
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-24 08:11:37 -07:00
John Nunley 604d461172
feat: Support blocking and non-blocking operations on the same mutex
Signed-off-by: John Nunley <dev@notgull.net>
2023-09-22 20:12:23 -07:00
John Nunley c78896411f
Merge pull request #43 from smol-rs/notgull/evl-v3.0.0
Bump to event-listener v3.0.0
2023-09-17 08:07:58 -07:00
John Nunley 3a82590a69 Add a default "std" feature for no_std usage
This is a breaking change for no-default-features users.

Signed-off-by: John Nunley <dev@notgull.net>
2023-09-17 07:58:04 -07:00
jtnunley 8f8b4fea18 Bump to event-listener v3.0.0
The new version of event-listener comes with several new changes, including less
heap allocation and no_std support.

This is a breaking change as it makes a handful of futures !Unpin.

Signed-off-by: John Nunley <dev@notgull.net>
2023-09-17 07:57:33 -07:00
Taiki Endo c76dc0811b Update actions/checkout action to v4 2023-09-10 18:19:03 +09:00
John Nunley a125498595
v2.8.0
Signed-off-by: John Nunley <dev@notgull.net>
2023-08-09 19:15:28 -07:00
John Nunley 8045684f99
Add smol-rs logo (#52) 2023-07-17 14:40:02 +09:00
Pierre Krieger 65b6cb97c4
bugfix: Replace `target_os = "wasm64"` with `target_arch = "wasm64"` 2023-07-13 06:58:44 -07:00
Jules Bertholet 0b7252c71f
Fix UB in `MutexGuardArc::source` (#50)
The alternative would be to change the `Sync` impl for  `MutexGuardArc`
to require `T: Send + Sync`.
2023-07-08 01:21:20 +09:00
Jules Bertholet d22ee4e63c
Loosen `Send`/`Sync` bounds on `Mutex` and `RwLock` futures (#48) 2023-06-14 18:06:05 -07:00
Jules Bertholet 936e046e5a
feat: Add reference-counted versions of `RwLock` guards (#47)
Adds reference-counted versions of `RwLock` guards to #33.
2023-06-13 21:18:11 -07:00
dependabot[bot] e5fdc9ea5a Update fastrand requirement from 1.4.0 to 2.0.0
Updates the requirements on [fastrand](https://github.com/smol-rs/fastrand) to permit the latest version.
- [Release notes](https://github.com/smol-rs/fastrand/releases)
- [Changelog](https://github.com/smol-rs/fastrand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/fastrand/compare/v1.4.0...v2.0.0)

---
updated-dependencies:
- dependency-name: fastrand
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-11 16:04:28 +09:00
Jules Bertholet 90b1a30f39
fix: Fix deadlock introduced in 0b71083 2023-05-28 18:16:42 -07:00
Jules Bertholet 0b71083fc2
chore: Make `RwLockReadGuard` covariant (#45)
Closes #9 by making the RwLockReadGuard type covariant.

This involves splitting the RwLock implementation into a "raw" RwLock part and the public API.
2023-05-26 21:35:29 -07:00
Jules Bertholet 99a44a5b45
feature: Add Semaphore::add_permits()
This function allows increasing the permit count after creation.
2023-05-26 19:39:40 -07:00
SNCPlay42 6bac58a9c9
fix: don't busy wait in SemaphoreGuard::acquire_arc (#42)
Closes #41 by fixing buggy waiting code.
2023-05-26 17:55:24 -07:00
John Nunley f738cfd068
Use pin macro instead of new_unchecked (#40)
Addresses concerns that the variable was not being properly pinned.
2023-04-30 12:53:23 -07:00
Taiki Endo 2232df7df7 Minimize GITHUB_TOKEN permissions
Refs: https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token
2023-03-26 16:36:56 +09:00
Taiki Endo 8b97c4e4ee Set CARGO_NET_GIT_FETCH_WITH_CLI=true in CI 2023-03-04 11:42:04 +09:00
John Nunley e525424be3
v2.7.0 (#38) 2023-02-26 07:06:40 -08:00
Caio 39e0b6dc75
Mark `MutexGuard` with `#[clippy::has_significant_drop]` (#37)
* Mark `MutexGuard` with `#[clippy::has_significant_drop]`

`#[clippy::has_significant_drop]` tells that a structure should be considered when evaluating some lints. Examples of such behavior are the existent `clippy::significant_drop_in_scrutinee` and in the soon-to-be-finished https://github.com/rust-lang/rust-clippy/issues/9399.

* Include more structures
2023-02-03 15:04:57 -08:00
John Nunley 350cda03d9
m: Remove futures-lite dependency (#36) 2023-01-26 14:13:16 -08:00
John Nunley 15049aa1c9
Replace some async blocks with manual futures (#34)
* Replace some async blocks with manual futures

* Fix WASM build

* Use a slightly more idiomatic way to access event listeners

* Fix MIRI failure

* Code review
2022-12-28 20:30:48 -08:00
Taiki Endo 61922eb271 Enable dependabot update for Rust 2022-12-28 12:26:48 +09:00
Taiki Endo a0cbfef5f2 Clean up CI config 2022-12-28 12:26:48 +09:00
Taiki Endo 7151987230 Remove msrv field from .clippy.toml
Since Rust 1.64, Clippy respects `rust-version` field in Cargo.toml.
rust-lang/rust@b776fb8
2022-12-28 12:26:48 +09:00
Taiki Endo 5a89518c9d Release 2.6.0 2022-10-26 01:36:49 +09:00