mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 00:59:39 +02:00
Remove LOCK in OmemoManager and use Manager instance instead
This commit is contained in:
parent
d7b7abc7eb
commit
9923268391
4 changed files with 103 additions and 132 deletions
|
@ -55,6 +55,7 @@ public class MessageEncryptionIntegrationTest extends AbstractTwoUsersOmemoInteg
|
|||
* Bob still has B2
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("SynchronizeOnNonFinalField")
|
||||
@SmackIntegrationTest
|
||||
public void messageTest() throws Exception {
|
||||
OmemoBundleElement a1 = alice.getOmemoService().getOmemoStoreBackend().packOmemoBundle(alice.getOwnDevice());
|
||||
|
@ -74,7 +75,7 @@ public class MessageEncryptionIntegrationTest extends AbstractTwoUsersOmemoInteg
|
|||
OmemoBundleElement a1_ = alice.getOmemoService().getOmemoStoreBackend().packOmemoBundle(alice.getOwnDevice());
|
||||
OmemoBundleElement b2;
|
||||
|
||||
synchronized (bob.LOCK) { // Circumvent race condition where bundle gets replenished after getting stored in b2
|
||||
synchronized (bob) { // Circumvent race condition where bundle gets replenished after getting stored in b2
|
||||
b2 = bob.getOmemoService().getOmemoStoreBackend().packOmemoBundle(bob.getOwnDevice());
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ public class SessionRenegotiationIntegrationTest extends AbstractTwoUsersOmemoIn
|
|||
super(environment);
|
||||
}
|
||||
|
||||
@SuppressWarnings("SynchronizeOnNonFinalField")
|
||||
@SmackIntegrationTest
|
||||
public void sessionRenegotiationTest() throws Exception {
|
||||
|
||||
|
@ -50,7 +51,7 @@ public class SessionRenegotiationIntegrationTest extends AbstractTwoUsersOmemoIn
|
|||
bob.removeOmemoMessageListener(listener1);
|
||||
|
||||
// Remove the session on Bobs side.
|
||||
synchronized (bob.LOCK) {
|
||||
synchronized (bob) {
|
||||
bob.getOmemoService().getOmemoStoreBackend().removeRawSession(bob.getOwnDevice(), alice.getOwnDevice());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue