Beispiel
once_cell 1.21.4: Distinguish non-blocking race initialization from blocking sync initialization in once_cell, proving that race::OnceBox executes all concurrent closures and drops loser allocations, permits re-entrancy without deadlocking, and does not poison on panics
Verifiziertes Beispiel für cargo once_cell 1.21.4: Distinguish non-blocking race initialization from blocking sync initialization in once_cell, proving that…
sha256:bf34c4b96e5d2e5c6749e27e05216e4f465933461e70adea2f1b2170b3c1b021
Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen.
Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen.
MIT-0
Ausführungsbelege
Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.
- Beleggrundlage
- Signierter Vertrag bestanden
- Verifizierungsbelege
- 2
- Signaturschlüssel, die es gebaut haben
- 2
Deklarierte Umgebung
rust linux x64 rust rust cargo
Umgebungen der Verifizierungsläufe
| Umgebung | Contract | Stufen | Lauf |
|---|---|---|---|
| rust 1 · linux alpine/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · cargo@1 |
2026-08-16 |
| rust 1 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · cargo@1 |
2026-08-18 |
Fall
HOW- Ziel
- Distinguish non-blocking race initialization from blocking sync initialization in once_cell, proving that race::OnceBox executes all concurrent closures and drops loser allocations, permits re-entrancy without deadlocking, and does not poison on panics
- Pakete
- Symbole
-
- once_cell::race::OnceBox
- once_cell::race::OnceBox::get_or_init
- once_cell::race::OnceBox::set
- once_cell::race::OnceBox::clone
- once_cell::race::OnceNonZeroUsize
- once_cell::race::OnceBool
- once_cell::race::OnceRef
- once_cell::sync::OnceCell
- once_cell::sync::OnceCell::get_or_init
- once_cell::sync::OnceCell::set
- once_cell::sync::OnceCell::try_insert
- once_cell::unsync::OnceCell
- once_cell::unsync::OnceCell::get_or_init
- Umgebung
- rust
- Erstellt
- 2026-08-16T08:11:04Z
Contract
- assert race::OnceBox executes all 16 contending closures concurrently while immediately dropping all 15 losing heap allocations and storing exactly one winner
- assert sync::OnceCell blocks contending threads and executes its initialization closure exactly once across all 16 threads
- assert race::OnceBox allows re-entrant initialization where inner init wins and outer value is discarded, whereas unsync::OnceCell panics with 'reentrant init' and sync::OnceCell deadlocks
- assert panics during get_or_init do not poison sync::OnceCell or race::OnceBox, leaving them uninitialized and available for subsequent successful initialization
- assert sync::OnceCell::set returns Err(T), sync::OnceCell::try_insert returns Err((&T, T)), race::OnceBox::set returns Err(Box<T>), and race::OnceNonZeroUsize/OnceBool return Err(()) on collision
- assert race::OnceBox::clone on an initialized cell deep-clones into an independent heap allocation, while an uninitialized clone remains empty
- assert race::OnceRef stores borrowed references without heap allocation and rejects subsequent writes with Err(())
Dateien
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs