Skip to content

Commit 079df54

Browse files
JamesJames
authored andcommitted
2 parents b886082 + 43c1853 commit 079df54

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/tinystruct/examples/talk.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
import org.tinystruct.AbstractApplication;
2525
import org.tinystruct.ApplicationException;
26-
import org.tinystruct.ApplicationRuntimeException;
2726
import org.tinystruct.data.component.Builder;
2827
import org.tinystruct.system.ApplicationManager;
2928

@@ -35,9 +34,8 @@ public class talk extends AbstractApplication {
3534
protected final Map<String, Queue<Builder>> list = new ConcurrentHashMap<String, Queue<Builder>>();
3635
protected final Map<String, List<String>> sessions = new ConcurrentHashMap<String, List<String>>();
3736
private ExecutorService service;
38-
private Lock lock = new ReentrantLock();
39-
private Condition consumer = lock.newCondition();
40-
private Condition producer = lock.newCondition();
37+
private final Lock lock = new ReentrantLock();
38+
private final Condition consumer = lock.newCondition();
4139

4240
@Override
4341
public void init() {
@@ -146,7 +144,6 @@ public final String update(final String sessionId) throws ApplicationException,
146144
throw new ApplicationException(e.getMessage(), e);
147145
}
148146
}
149-
producer.signalAll();
150147
lock.unlock();
151148
return message.toString();
152149
}
@@ -176,11 +173,6 @@ private final void copy(Object meetingCode, Builder builder) {
176173
Entry<String, Queue<Builder>> list = iterator.next();
177174
if(_sessions.contains(list.getKey())) {
178175
lock.lock();
179-
try {
180-
producer.await();
181-
} catch (InterruptedException e) {
182-
throw new ApplicationRuntimeException(e.getMessage(), e);
183-
}
184176
list.getValue().add(builder);
185177
consumer.signalAll();
186178
lock.unlock();

0 commit comments

Comments
 (0)