dewildte
11/19/2020, 5:03 PMDispatchQue
?
I have a MutableMap<T,T>
and I want to make operations done to it thread safe.
So far I just wrap accesses to it in:
val lock = Any()
synchronised(lock) { map.doTheThing() }
Is this fine?Marc Knaup
11/19/2020, 5:05 PMdewildte
11/19/2020, 5:07 PMsynchronized
and the same static lock. Is that fine?Marc Knaup
11/19/2020, 5:08 PMnanodeath
11/19/2020, 5:09 PMdewildte
11/19/2020, 5:12 PMdewildte
11/19/2020, 5:12 PMdewildte
11/19/2020, 5:13 PMdewildte
11/19/2020, 5:13 PM