Deduplicate concurrent function calls by key. Inspired by Go's singleflight.
A weighted semaphore for bounding concurrent access to a shared resource.