projects
/
xudocci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove channel we’re kicked from from the correct collection.
[xudocci.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
xdcc
/
core
/
Core.java
diff --git
a/src/main/java/net/pterodactylus/xdcc/core/Core.java
b/src/main/java/net/pterodactylus/xdcc/core/Core.java
index
1b45c6a
..
30da4a8
100644
(file)
--- a/
src/main/java/net/pterodactylus/xdcc/core/Core.java
+++ b/
src/main/java/net/pterodactylus/xdcc/core/Core.java
@@
-105,6
+105,7
@@
public class Core extends AbstractExecutionThreadService {
/** The logger. */
private static final Logger logger = Logger.getLogger(Core.class.getName());
/** The logger. */
private static final Logger logger = Logger.getLogger(Core.class.getName());
+ private final Object syncObject = new Object();
/** The event bus. */
private final EventBus eventBus;
private final ConnectionFactory connectionFactory;
/** The event bus. */
private final EventBus eventBus;
private final ConnectionFactory connectionFactory;
@@
-376,10
+377,15
@@
public class Core extends AbstractExecutionThreadService {
@Override
protected void run() throws Exception {
while (isRunning()) {
@Override
protected void run() throws Exception {
while (isRunning()) {
- try {
- Thread.sleep(TimeUnit.MINUTES.toMillis(1));
- } catch (InterruptedException ie1) {
- /* ignore. */
+ synchronized (syncObject) {
+ try {
+ syncObject.wait(TimeUnit.MINUTES.toMillis(1));
+ } catch (InterruptedException ie1) {
+ /* ignore. */
+ }
+ }
+ if (!isRunning()) {
+ break;
}
/* find channels that should be monitored but are not. */
}
/* find channels that should be monitored but are not. */
@@
-408,7
+414,10
@@
public class Core extends AbstractExecutionThreadService {
}
@Override
}
@Override
- protected void shutDown() {
+ protected void triggerShutdown() {
+ synchronized (syncObject) {
+ syncObject.notifyAll();
+ }
}
//
}
//
@@
-668,9
+677,9
@@
public class Core extends AbstractExecutionThreadService {
return;
}
return;
}
- extraChannels.remove(channel);
+ extraChannels.remove(channel
.get()
);
} else {
} else {
-
c
hannels.remove(channel.get());
+
joinedC
hannels.remove(channel.get());
}
eventBus.post(new GenericMessage(format(
"Kicked from %s by %s: %s",
}
eventBus.post(new GenericMessage(format(
"Kicked from %s by %s: %s",