1
2
Fork
You've already forked spin
0

Update documentation for Once to reference std::sync::OnceLock. #159

Open
briansmith wants to merge 1 commit from briansmith/b/unlike-std into master
pull from: briansmith/b/unlike-std
merge into: zesterer:master
zesterer:master
zesterer:fixes
zesterer:fix-ub
zesterer:revert-127-ci
zesterer:spinlock
briansmith commented 2023年12月01日 23:07:22 +01:00 (Migrated from github.com)
Copy link
No description provided.
zesterer (Migrated from github.com) reviewed 2023年12月02日 00:34:11 +01:00
@ -39,8 +39,6 @@
//!
zesterer (Migrated from github.com) commented 2023年12月02日 00:33:59 +01:00
Copy link

What's the reason for removing this?

What's the reason for removing this?
@ -8,9 +8,7 @@ use core::{cell::UnsafeCell, fmt, marker::PhantomData, mem::MaybeUninit};
zesterer (Migrated from github.com) commented 2023年12月02日 00:32:33 +01:00
Copy link

Hmm, I think this is probably too strong a statement. They're definitely very similar, but the APIs differ enough that I'd probably go for something like:

This type has similar behaviour to `std::sync::OnceLock`.
Hmm, I think this is probably too strong a statement. They're definitely very similar, but the APIs differ enough that I'd probably go for something like: ``` This type has similar behaviour to `std::sync::OnceLock`. ```
briansmith (Migrated from github.com) reviewed 2023年12月02日 00:48:47 +01:00
@ -39,8 +39,6 @@
//!
briansmith (Migrated from github.com) commented 2023年12月02日 00:48:47 +01:00
Copy link

Previously, we were comparing spin::Once to std::sync::Once, which didn't own the result of the initializer. Now we're comparing it to OnceLock, which does own the result of the initializer.

Previously, we were comparing `spin::Once` to `std::sync::Once`, which didn't own the result of the initializer. Now we're comparing it to `OnceLock`, which does own the result of the initializer.
briansmith (Migrated from github.com) reviewed 2023年12月02日 00:50:48 +01:00
@ -8,9 +8,7 @@ use core::{cell::UnsafeCell, fmt, marker::PhantomData, mem::MaybeUninit};
briansmith (Migrated from github.com) commented 2023年12月02日 00:50:47 +01:00
Copy link

The previous "equivalent" was already much stronger language than "analogous," which isn't any stronger of a statement than "similar behavio[u]r." For most people, if they need a spinlock variant of std::sync::OnceLock then they'll consider spin::Once.

The previous "equivalent" was already much stronger language than "analogous," which isn't any stronger of a statement than "similar behavio[u]r." For most people, if they need a spinlock variant of `std::sync::OnceLock` then they'll consider `spin::Once`.
zesterer commented 2023年12月09日 16:34:13 +01:00 (Migrated from github.com)
Copy link

Apologies for not finishing off this review earlier, I've had a lot on this week. I should be in a position to finish this off tomorrow.

Apologies for not finishing off this review earlier, I've had a lot on this week. I should be in a position to finish this off tomorrow.
tgross35 commented 2024年07月10日 21:03:52 +02:00 (Migrated from github.com)
Copy link

The same updates could probably be applied to spin::Lazy now that std::sync::LazyLock is now stable.

The same updates could probably be applied to `spin::Lazy` now that `std::sync::LazyLock` is now stable.
This pull request has changes conflicting with the target branch.
  • src/lib.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin briansmith/b/unlike-std:briansmith/b/unlike-std
git switch briansmith/b/unlike-std

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff briansmith/b/unlike-std
git switch briansmith/b/unlike-std
git rebase master
git switch master
git merge --ff-only briansmith/b/unlike-std
git switch briansmith/b/unlike-std
git rebase master
git switch master
git merge --no-ff briansmith/b/unlike-std
git switch master
git merge --squash briansmith/b/unlike-std
git switch master
git merge --ff-only briansmith/b/unlike-std
git switch master
git merge briansmith/b/unlike-std
git push origin master
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zesterer/spin!159
Reference in a new issue
zesterer/spin
No description provided.
Delete branch "briansmith/b/unlike-std"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?