| 159 | super().__init__(*args, **kwds) |
| 160 | |
| 161 | def __delitem__(self, item): |
| 162 | super().__delitem__(item) |
| 163 | |
| 164 | # Notify that the cache is empty. This is important because the |
| 165 | # pool keeps maintaining workers until the cache gets drained. This |
| 166 | # eliminates a race condition in which a task is finished after the |
| 167 | # the pool's _handle_workers method has enter another iteration of the |
| 168 | # loop. In this situation, the only event that can wake up the pool |
| 169 | # is the cache to be emptied (no more tasks available). |
| 170 | if not self: |
| 171 | self.notifier.put(None) |
| 172 | |
| 173 | class Pool(object): |
| 174 | ''' |