You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2022/11/22 12:11:45 UTC
[whimsy] branch master updated: Make users buffer fully thread-safe (#169)
This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new fbe1a991 Make users buffer fully thread-safe (#169)
fbe1a991 is described below
commit fbe1a991e0e09210f519a7b91b14699b55fc0503
Author: Maciej Mensfeld <ma...@mensfeld.pl>
AuthorDate: Tue Nov 22 13:11:40 2022 +0100
Make users buffer fully thread-safe (#169)
Under intense threading usage, the `@@users` buffer will not be thread-safe fully. Details here:
ref https://github.com/ruby-concurrency/concurrent-ruby/issues/970
---
www/board/agenda/daemon/channel.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/www/board/agenda/daemon/channel.rb b/www/board/agenda/daemon/channel.rb
index 3b609ad8..b26491ea 100644
--- a/www/board/agenda/daemon/channel.rb
+++ b/www/board/agenda/daemon/channel.rb
@@ -15,7 +15,7 @@ require 'whimsy/asf/svn'
class Channel
@@sockets = Concurrent::Map.new
- @@users = Concurrent::Map.new {|map,key| map[key]=[]}
+ @@users = Concurrent::Map.new {|map,key| map.compute_if_absent(key) { [] } }
begin
FOUNDATION_BOARD = ASF::SVN['foundation_board']