mirror of https://github.com/deavminet/dnetd.git
Fixed code whereby mutex would never be unlocked if channel was found
This commit is contained in:
parent
bf74c74891
commit
723d44aa1f
|
@ -131,6 +131,9 @@ public class DServer : Thread
|
||||||
|
|
||||||
public DChannel getChannelByName(string channelName)
|
public DChannel getChannelByName(string channelName)
|
||||||
{
|
{
|
||||||
|
/* The channel */
|
||||||
|
DChannel channel = null;
|
||||||
|
|
||||||
/* Lock the channels list */
|
/* Lock the channels list */
|
||||||
channelLock.lock();
|
channelLock.lock();
|
||||||
|
|
||||||
|
@ -138,14 +141,15 @@ public class DServer : Thread
|
||||||
{
|
{
|
||||||
if(cmp(currentChannel.getName(), channelName) == 0)
|
if(cmp(currentChannel.getName(), channelName) == 0)
|
||||||
{
|
{
|
||||||
return currentChannel;
|
channel = currentChannel;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unlock the channels list */
|
/* Unlock the channels list */
|
||||||
channelLock.unlock();
|
channelLock.unlock();
|
||||||
|
|
||||||
return null;
|
return channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DChannel[] getChannels()
|
public DChannel[] getChannels()
|
||||||
|
|
Loading…
Reference in New Issue