Correct use of locks is to use a try/finally block, so correct
the usage to shut FB up.
Change-Id: I8e42425a9566f506682a8f3e2c25ac3dfe4ec812
Signed-off-by: Robert Varga <rovarga@cisco.com>
actorSystem.mailboxes().settings();
lock.lock();
actorSystem.mailboxes().settings();
lock.lock();
- //queue capacity = 10
- //need to send 12 messages; 1 message is dequeued and actor waits on lock,
- //2nd to 11th messages are put on the queue
- //12th message is sent to dead letter.
- for (int i = 0; i < 12; i++) {
- pingPongActor.tell("ping", mockReceiver.getRef());
- }
-
- mockReceiver.expectMsgClass(twentySeconds, DeadLetter.class);
+ try {
+ //queue capacity = 10
+ //need to send 12 messages; 1 message is dequeued and actor waits on lock,
+ //2nd to 11th messages are put on the queue
+ //12th message is sent to dead letter.
+ for (int i = 0; i < 12; i++) {
+ pingPongActor.tell("ping", mockReceiver.getRef());
+ }
+ mockReceiver.expectMsgClass(twentySeconds, DeadLetter.class);
+ } finally {
+ lock.unlock();
+ }
mockReceiver.receiveN(11, twentySeconds);
}
mockReceiver.receiveN(11, twentySeconds);
}