| 14 | ) |
| 15 | |
| 16 | type Set struct { |
| 17 | entitlementsMu sync.RWMutex |
| 18 | entitlements codersdk.Entitlements |
| 19 | // right2Update works like a semaphore. Reading from the chan gives the right to update the set, |
| 20 | // and you send on the chan when you are done. We only allow one simultaneous update, so this |
| 21 | // serve to serialize them. You MUST NOT attempt to read from this channel while holding the |
| 22 | // entitlementsMu lock. It is permissible to acquire the entitlementsMu lock while holding the |
| 23 | // right2Update token. |
| 24 | right2Update chan struct{} |
| 25 | } |
| 26 | |
| 27 | func New() *Set { |
| 28 | s := &Set{ |
nothing calls this directly
no outgoing calls
no test coverage detected