Commit d6faff0
committed
core: wake Waker outside of lock.
Given:
- Broker asleep in poll()
- thread B calling Latch.put()
Previously,
- B takes lock,
- B wakes socket by dropping GIL and writing to it
- Broker wakes from poll(), acquires GIL only to find Latch._lock is held
- Broker drops GIL, sleeps on futex() for _lock
- B wakes, acquires GIL, releases _lock
- Broker wakes from futex(), acquires lock
Now,
- B takes lock, updates state, releases lock
- B wakes socket by droppping GIL and writing to it
- Broker wakes from poll(), acquires GIL and _lock
- Everyone lives happily ever after.1 parent 807cbef commit d6faff0
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2613 | 2613 | | |
2614 | 2614 | | |
2615 | 2615 | | |
2616 | | - | |
2617 | | - | |
| 2616 | + | |
2618 | 2617 | | |
2619 | 2618 | | |
2620 | 2619 | | |
2621 | 2620 | | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
2622 | 2624 | | |
2623 | 2625 | | |
2624 | 2626 | | |
| |||
0 commit comments