Closed m8nmueller closed 2 months ago
I squashed the commits now without changing the overall code diff before/after.
The tests failure we just had showed a minor mistake in the test conception. I hate using platform locks on gears futures.
Should all be solved now. Merge as you are :)
This PR contains primitives for synchronization and concurrency management:
Resource
to wrap allocation/cleanup of (currently mostly computation) resources in different layers of safetySemaphore
, because it's useful Additionally, the specification ofAsync.await
in light of locking Sources, that care about there result being used (like Semaphores which the consumer might want to reset on cancellation), was clarified and implemented. Now, cancellation will be ignored if it happens after a listener lock acquire that leads to completion. Still, cancellation can be requested synchronously without waiting.