Commit e832422
committed
Make Binder transport triggerEvent thread-safe and guarantee ordering.
Updated ServerInbound.triggerEvent to invoke the listener's triggerEvent
callback inside the synchronized(this) block. This ensures that the check
for isClosed() and the invocation of the listener are atomic relative to
stream closure (which also runs under the same lock).
This prevents a race where triggerEvent could be called on the listener
after the stream has been closed, which would result in out-of-order
events delivered to the application.
This is consistent with how other listener callbacks (like closed and
halfClosed) are delivered in Inbound.java.
TAG=agy
CONV=e1bfa5a2-e855-4f79-abdd-ef2b264977be1 parent b9e1e2b commit e832422
1 file changed
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
672 | | - | |
673 | 672 | | |
674 | 673 | | |
675 | 674 | | |
676 | 675 | | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
681 | 679 | | |
682 | 680 | | |
683 | 681 | | |
| |||
0 commit comments