Enter a context where the lock is with group `group_id`. Args: group_id: The group for which to acquire and release the lock. Returns: A context manager which will acquire the lock for `group_id`.
(self, group_id)
| 72 | self._group_member_counts = [0] * self._num_groups |
| 73 | |
| 74 | def group(self, group_id): |
| 75 | """Enter a context where the lock is with group `group_id`. |
| 76 | |
| 77 | Args: |
| 78 | group_id: The group for which to acquire and release the lock. |
| 79 | |
| 80 | Returns: |
| 81 | A context manager which will acquire the lock for `group_id`. |
| 82 | """ |
| 83 | self._validate_group_id(group_id) |
| 84 | return self._Context(self, group_id) |
| 85 | |
| 86 | def acquire(self, group_id): |
| 87 | """Acquire the group lock for a specific group `group_id`.""" |