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

Make Barrier::new() const #119536

Merged
merged 1 commit into from
Feb 23, 2024
Merged

Conversation

Jules-Bertholet
Copy link
Contributor

@Jules-Bertholet Jules-Bertholet commented Jan 3, 2024

I guess this was just missed in #97791?

@rustbot label T-libs-api -T-libs

@rustbot
Copy link
Collaborator

rustbot commented Jan 3, 2024

r? @thomcc

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 3, 2024
@thomcc
Copy link
Member

thomcc commented Jan 22, 2024

Seems fine to me but needs libs-api.

r? libs-api

@rustbot rustbot assigned BurntSushi and unassigned thomcc Jan 22, 2024
@dtolnay dtolnay assigned dtolnay and unassigned BurntSushi Jan 26, 2024
@dtolnay dtolnay added the needs-fcp This change is insta-stable, so needs a completed FCP to proceed. label Jan 26, 2024
@dtolnay
Copy link
Member

dtolnay commented Jan 26, 2024

@rust-lang/libs-api:
@rfcbot fcp merge

This enables using std::sync::Barrier in static, as was recently done for Mutex and some other synchronization types.

use std::sync::Barrier;
use std::thread;
use std::time::Duration;

static BARRIER: Barrier = Barrier::new(3);

fn main() {
    loop {
        thread::spawn(|| {
            BARRIER.wait();
            println!("{:?}", thread::current().id());
        });
        thread::sleep(Duration::from_millis(300));
    }
}

@rfcbot
Copy link

rfcbot commented Jan 26, 2024

Team member @dtolnay has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Jan 26, 2024
@rfcbot rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Feb 13, 2024
@rfcbot
Copy link

rfcbot commented Feb 13, 2024

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Feb 23, 2024
@rfcbot
Copy link

rfcbot commented Feb 23, 2024

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Thank you!

@dtolnay
Copy link
Member

dtolnay commented Feb 23, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Feb 23, 2024

📌 Commit 3c9aa69 has been approved by dtolnay

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 23, 2024
@bors
Copy link
Contributor

bors commented Feb 23, 2024

⌛ Testing commit 3c9aa69 with merge 8f359be...

@bors
Copy link
Contributor

bors commented Feb 23, 2024

☀️ Test successful - checks-actions
Approved by: dtolnay
Pushing 8f359be to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 23, 2024
@bors bors merged commit 8f359be into rust-lang:master Feb 23, 2024
12 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 23, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8f359be): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.3% [1.3%, 1.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 650.231s -> 648.482s (-0.27%)
Artifact size: 310.96 MiB -> 310.98 MiB (0.01%)

@Jules-Bertholet Jules-Bertholet deleted the const-barrier branch February 24, 2024 00:52
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. merged-by-bors This PR was explicitly merged by bors. needs-fcp This change is insta-stable, so needs a completed FCP to proceed. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants