Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::thread support for the Nintendo 3DS #98514

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Seal the BuilderExt trait
  • Loading branch information
AzureMarker committed Jul 12, 2022
commit bfd108dcabdcad49f8fade0e696e9fc6df4047f4
7 changes: 6 additions & 1 deletion library/std/src/os/horizon/thread.rs
Original file line number Diff line number Diff line change
@@ -21,10 +21,15 @@

#![unstable(feature = "horizon_thread_ext", issue = "none")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at creating a tracking issue for this, but held off for now due to this note in the template:

If the new feature is small, it may be fine to skip the RFC process. In that
case, you can use use issue = "none" in your initial implementation PR. The
reviewer will ask you to open a tracking issue if they agree your feature can be
added without an RFC.

So once someone comments that this is an acceptable feature to skip an RFC for, I can create the tracking issue.


use crate::sealed::Sealed;

/// Extensions on [`std::thread::Builder`] for the Nintendo 3DS.
///
/// This trait is sealed: it cannot be implemented outside the standard library.
/// This is so that future additional methods are not breaking changes.
///
/// [`std::thread::Builder`]: crate::thread::Builder
pub trait BuilderExt: Sized {
pub trait BuilderExt: Sized + Sealed {
/// Sets the priority level for the new thread.
///
/// Low values gives the thread higher priority. For userland apps, this has
4 changes: 4 additions & 0 deletions library/std/src/thread/mod.rs
Original file line number Diff line number Diff line change
@@ -272,6 +272,10 @@ pub struct Builder {
pub(crate) native_options: imp::BuilderOptions,
}

/// Allows extension traits within `std`.
#[unstable(feature = "sealed", issue = "none")]
impl crate::sealed::Sealed for Builder {}

impl Builder {
/// Generates the base configuration for spawning a thread, from which
/// configuration methods can be chained.