Commit 95ca5850 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Modified syncrhonization blocks to use finer-grained locks.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@683 b35dd754-fafc-0310-a699-88a17e54d16e
parent c5699655
...@@ -268,7 +268,7 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha ...@@ -268,7 +268,7 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
public MUCRoom getChatRoom(String roomName, JID userjid) throws UnauthorizedException { public MUCRoom getChatRoom(String roomName, JID userjid) throws UnauthorizedException {
MUCRoom room = null; MUCRoom room = null;
synchronized (rooms) { synchronized (roomName.intern()) {
room = rooms.get(roomName.toLowerCase()); room = rooms.get(roomName.toLowerCase());
if (room == null) { if (room == null) {
room = new MUCRoomImpl(this, roomName, router); room = new MUCRoomImpl(this, roomName, router);
...@@ -347,7 +347,7 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha ...@@ -347,7 +347,7 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
throw new IllegalStateException("Not initialized"); throw new IllegalStateException("Not initialized");
} }
MUCUser user = null; MUCUser user = null;
synchronized (users) { synchronized (userjid.toString().intern()) {
user = users.get(userjid); user = users.get(userjid);
if (user == null) { if (user == null) {
user = new MUCUserImpl(this, router, userjid); user = new MUCUserImpl(this, router, userjid);
......
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