Files
Jacob Pratt f2b7994a66 Rollup merge of #158679 - cyexclam:sync-document-blocking-guarantees, r=clarfonthey
Document blocking guarantees for `std::sync`

Per rust-lang/rust#157728, this PR documents how exactly functions/methods in `std::mpsc` (and `mpmc`) block.

Copied from the issue:
> For the wasm part of this specifically, yes, using a mutex anywhere is basically forbidden on the main thread in browsers. Personally I don't think it's reasonable to expect the standard library to use zero mutexes on wasm and make absolutely everything lock-free. This is a consequence of browsers and not something Rust can "just" fix. Basically I would not recommend changing the implementation and instead leaving it as-is. I'll note that there's a long and storied history of blocking-the-main-thread-with-wasm-threads in the browser, and I'm not putting in all the context here.
>
> \- alexcrichton

(P.S. documentation seems to be line wrapped but doesn't have a consistent wrapping width? I tried to match the surrounding style as best as I could; let me know if there's something better I should've done)

Fixes rust-lang/rust#157728
2026-07-06 22:17:45 -04:00
..
2026-07-06 19:36:40 +10:00
2026-06-30 09:01:03 +00:00