Skip to content

Commit 4331406

Browse files
committed
!doc
1 parent adf317b commit 4331406

File tree

1 file changed

+6
-1
lines changed
  • crates/matrix-sdk/src/event_cache

1 file changed

+6
-1
lines changed

crates/matrix-sdk/src/event_cache/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,19 @@ struct EventCacheInner {
270270
/// on the owning client.
271271
client: Weak<ClientInner>,
272272

273+
/// A lock used when many rooms must be updated at once.
274+
///
275+
/// [`Mutex`] is “fair”, as it is implemented as a FIFO. It is important to
276+
/// ensure that multiple updates will be applied in the correct order, which
277+
/// is enforced by taking this lock when handling an update.
278+
// TODO: that's the place to add a cross-process lock!
273279
multiple_room_updates_lock: Mutex<()>,
274280

275281
/// Lazily-filled cache of live [`RoomEventCache`], once per room.
276282
by_room: RwLock<BTreeMap<OwnedRoomId, RoomEventCache>>,
277283

278284
/// Handles to keep alive the task listening to updates.
279285
drop_handles: OnceLock<Arc<EventCacheDropHandles>>,
280-
// TODO: that's the place to add a cross-process lock!
281286
}
282287

283288
impl EventCacheInner {

0 commit comments

Comments
 (0)