Skip to content

Commit 4264229

Browse files
committed
Correct synchronization guard in groupByUntil
Can't see how `synchronized (key) { ... }` could have been correct here; `key` will hardly ever be the same instance for different invocations of `keySelector`, and the comment on line 73 clearly states `gate` to be the guard for `map`.
1 parent b9fe278 commit 4264229

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rxjava-core/src/main/java/rx/operators/OperationGroupByUntil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public void onNext(TSource args) {
102102

103103
GroupSubject<TKey, TResult> g;
104104
boolean newGroup = false;
105-
synchronized (key) {
105+
synchronized (gate) {
106106
g = map.get(key);
107107
if (g == null) {
108108
g = create(key);

0 commit comments

Comments
 (0)