{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiekigermocjmuqrxx4gwh3vvtf3vjtiirmk3inz4ngg34lok5eno4",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mic4iwqdsqx2"
},
"path": "/t/drop-on-await-point/24119#post_4",
"publishedAt": "2026-03-30T13:21:15.000Z",
"site": "https://internals.rust-lang.org",
"tags": [
"cliffle.com",
"Mutex without lock, Queue without push: cancel safety in lilos"
],
"textContent": "Ddystopia:\n\n> Mostly mutexes do rely on the fact that they are not held across await points, to prevent deadlocks.\n\ni suppose this is semantics, but i find \"rely on\" to be innacurate, as `MutexGuard` and `RefCell::Ref` do nothing to prevent being held across an `await`point, and work perfectly fine when being held across one (as long as one doesn't deadlock them).\n\nbut it is true there are lints against doing so and they are good lints, because `await` points do strongly increase the chance of deadlocks.\n\ni really liked this on the subject of mutexes and `await` points, though it is technically more about cancel safety.\n\ncliffle.com\n\n### Mutex without lock, Queue without push: cancel safety in lilos\n\ni do agree with your goal, but i personally feel it should be more of a warning, like `must_use`",
"title": "Drop on `await` point"
}