Skip to content

Commit

Permalink
[JGRP-1805] Provide synchronized access for channel receiver.
Browse files Browse the repository at this point in the history
  • Loading branch information
rachmatowicz committed Mar 7, 2014
1 parent f7ee830 commit ef405d6
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions tests/junit/org/jgroups/tests/OverlappingUnicastMergeTest.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
package org.jgroups.tests;

import org.jgroups.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.jgroups.Address;
import org.jgroups.Event;
import org.jgroups.Global;
import org.jgroups.JChannel;
import org.jgroups.Message;
import org.jgroups.ReceiverAdapter;
import org.jgroups.View;
import org.jgroups.stack.ProtocolStack;
import org.jgroups.util.Util;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
* Tests overlapping merges, e.g. A: {A,B}, B: {A,B} and C: {A,B,C}. Tests unicast tables<br/>
* Related JIRA: https://jira.jboss.org/jira/browse/JGRP-940
Expand Down Expand Up @@ -192,8 +198,12 @@ public MyReceiver(String name) {
public void receive(Message msg) {
Address dest=msg.getDest();
boolean mcast=dest == null;
if(!mcast)
ucasts.add(msg);
if(!mcast) {
// JGRP-1805
synchronized(OverlappingUnicastMergeTest.class) {
ucasts.add(msg);
}
}
}

public void viewAccepted(View new_view) {
Expand Down

0 comments on commit ef405d6

Please sign in to comment.