lampepfl / gears

A strawman for a low-level async library in Scala 3.
https://lampepfl.github.io/gears/
Apache License 2.0
247 stars 24 forks source link

Remove nested listener locks #40

Closed natsukagami closed 6 months ago

natsukagami commented 7 months ago

Upon discussions with @m8nmueller, we discovered that race does not necessarily require nested locking of listeners (which is the only usage of the nested locks). Instead the race implementation can just re-use the upsteam listener's lock and provide one if not yet existed.

With this out, I think we can just remove all the nested locking mechanisms. Should a legitimate need is raised again in the future, we know that there is a sound and performant design ready.

Progress: