3
0
mirror of https://github.com/ergochat/ergo.git synced 2025-03-03 13:00:49 +01:00
Shivaram Lingamneni 60b861e07e fix a race in regenerateMembersCache
The rationale for why regenerateMembersCache didn't need to hold the Lock()
throughout was subtly wrong. It is true that at least some attempt to
regenerate the cache would see *all* the updates. However, it was possible for
the value of `result` generated by that attempt to lose the race for the final
assignment `channel.membersCache = result`.

The fix is to serialize the attempts to regenerate the cache, without adding
any additional locking on the underlying `Channel` fields via
`Channel.stateMutex`. This ensures that the final read from `Channel.members`
is paired with the final write to `Channel.membersCache`.
2017-11-07 14:38:18 -05:00
..
2017-10-15 07:58:18 +10:00
2017-10-07 22:19:37 +10:00
2017-10-06 12:44:11 +10:00
2017-10-15 16:18:14 +10:00
2017-11-03 02:36:55 -04:00
2017-11-03 02:36:55 -04:00
2017-10-29 07:59:56 +00:00
2017-10-26 04:19:01 -04:00
2017-10-29 04:35:15 +00:00
2017-10-15 19:46:25 -04:00
2017-11-03 02:36:55 -04:00
2017-10-29 07:59:56 +00:00
2017-10-15 22:37:36 -04:00
2017-06-15 10:14:19 -06:00
2017-11-03 02:36:55 -04:00
2017-11-03 02:36:55 -04:00
2017-11-03 02:36:55 -04:00
2017-06-15 10:14:19 -06:00
2017-11-03 02:36:55 -04:00
2017-06-15 10:14:19 -06:00
2017-07-14 17:21:53 +10:00
2017-10-30 05:21:47 -04:00