SE-0433: Synchronous Mutual Exclusion Lock

This is the same issue described in this thread: Are atomic globals supposed to work?. It's a known bug, and a pretty severe one, but yeah globals variables as well as static variables do not currently work with Atomic, Mutex, or even something simple like:

struct Hello: ~Copyable {
  let x: Any

  borrowing func hello() {}
}

let x = Hello(x: 123)

func something() {
  x.hello() // error: 'x' is borrowed and cannot be consumed
}
4 Likes