File tree 1 file changed +6
-1
lines changed
crates/matrix-sdk/src/event_cache
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -270,14 +270,19 @@ struct EventCacheInner {
270
270
/// on the owning client.
271
271
client : Weak < ClientInner > ,
272
272
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!
273
279
multiple_room_updates_lock : Mutex < ( ) > ,
274
280
275
281
/// Lazily-filled cache of live [`RoomEventCache`], once per room.
276
282
by_room : RwLock < BTreeMap < OwnedRoomId , RoomEventCache > > ,
277
283
278
284
/// Handles to keep alive the task listening to updates.
279
285
drop_handles : OnceLock < Arc < EventCacheDropHandles > > ,
280
- // TODO: that's the place to add a cross-process lock!
281
286
}
282
287
283
288
impl EventCacheInner {
You can’t perform that action at this time.
0 commit comments