Skip to content

Commit f126463

Browse files
authored
Merge pull request #793 from fxn/patch-1
Fixes a code comment in Concurrent::{Hash,Array}
2 parents 5b60a91 + c13f734 commit f126463

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/concurrent/array.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ module Concurrent
2121
# @!macro internal_implementation_note
2222
ArrayImplementation = case
2323
when Concurrent.on_cruby?
24-
# Because MRI never runs code in parallel, the existing
25-
# non-thread-safe structures should usually work fine.
24+
# Array is thread-safe in practice because CRuby runs
25+
# threads one at a time and does not do context
26+
# switching during the execution of C functions.
2627
::Array
2728

2829
when Concurrent.on_jruby?
@@ -63,4 +64,3 @@ class Array < ArrayImplementation
6364
end
6465

6566
end
66-

lib/concurrent/hash.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ module Concurrent
1515
# @!macro internal_implementation_note
1616
HashImplementation = case
1717
when Concurrent.on_cruby?
18-
# Because MRI never runs code in parallel, the existing
19-
# non-thread-safe structures should usually work fine.
18+
# Hash is thread-safe in practice because CRuby runs
19+
# threads one at a time and does not do context
20+
# switching during the execution of C functions.
2021
::Hash
2122

2223
when Concurrent.on_jruby?
@@ -56,4 +57,3 @@ class Hash < HashImplementation
5657
end
5758

5859
end
59-

0 commit comments

Comments
 (0)