Commit 29e38f98 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Fixed deadlock loading users and rosters. JM-615

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3657 b35dd754-fafc-0310-a699-88a17e54d16e
parent c4d3e12a
......@@ -83,7 +83,9 @@ public class RosterManager extends BasicModule implements GroupEventListener {
}
Roster roster = rosterCache.get(username);
if (roster == null) {
synchronized(username.intern()) {
// Synchronize using a unique key so that other threads loading the User
// and not the Roster cannot produce a deadlock
synchronized ((username + " ro").intern()) {
roster = rosterCache.get(username);
if (roster == null) {
// Not in cache so load a new one:
......@@ -554,7 +556,9 @@ public class RosterManager extends BasicModule implements GroupEventListener {
handler.process(presence);
}
}
catch (UnauthorizedException e) {}
catch (UnauthorizedException e) {
// Do nothing
}
}
private Collection<Group> getVisibleGroups(Group groupToCheck) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment