Skip to content

Commit fbe1a99

Browse files
authored
Make users buffer fully thread-safe (#169)
Under intense threading usage, the `@@users` buffer will not be thread-safe fully. Details here: ref ruby-concurrency/concurrent-ruby#970
1 parent 384a0e5 commit fbe1a99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

www/board/agenda/daemon/channel.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class Channel
1717
@@sockets = Concurrent::Map.new
18-
@@users = Concurrent::Map.new {|map,key| map[key]=[]}
18+
@@users = Concurrent::Map.new {|map,key| map.compute_if_absent(key) { [] } }
1919

2020
begin
2121
FOUNDATION_BOARD = ASF::SVN['foundation_board']

0 commit comments

Comments
 (0)