mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-24 00:29:52 +01:00
Database.setInboxGroup() doesn't require message lock.
This commit is contained in:
@@ -712,7 +712,7 @@ interface Database<T> {
|
||||
* Makes a group visible to the given contact, adds it to the contact's
|
||||
* subscriptions, and sets it as the inbox group for the contact.
|
||||
* <p>
|
||||
* Locking: contact read, message write, subscription write.
|
||||
* Locking: subscription write.
|
||||
*/
|
||||
public void setInboxGroup(T txn, ContactId c, Group g) throws DbException;
|
||||
|
||||
|
||||
@@ -1769,8 +1769,6 @@ DatabaseCleaner.Callback {
|
||||
|
||||
public void setInboxGroup(ContactId c, Group g) throws DbException {
|
||||
contactLock.readLock().lock();
|
||||
try {
|
||||
messageLock.writeLock().lock();
|
||||
try {
|
||||
subscriptionLock.writeLock().lock();
|
||||
try {
|
||||
@@ -1787,9 +1785,6 @@ DatabaseCleaner.Callback {
|
||||
} finally {
|
||||
subscriptionLock.writeLock().unlock();
|
||||
}
|
||||
} finally {
|
||||
messageLock.writeLock().unlock();
|
||||
}
|
||||
} finally {
|
||||
contactLock.readLock().unlock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user