Skip to content

Commit 11da3fe

Browse files
committed
Hide internal classes from public docs
1 parent 99f837a commit 11da3fe

File tree

9 files changed

+43
-35
lines changed

9 files changed

+43
-35
lines changed

lib/concurrent-ruby/concurrent/re_include.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ module Concurrent
3131
#
3232
# C1.new.respond_to? :a # => false
3333
# C2.new.respond_to? :a # => true
34+
#
35+
# @!visibility private
3436
module ReInclude
3537
# @!visibility private
3638
def included(base)

lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require 'concurrent/synchronization/abstract_lockable_object'
22

33
module Concurrent
4-
# noinspection RubyInstanceVariableNamingConvention
54
module Synchronization
65

76
# @!visibility private

lib/concurrent-ruby/concurrent/synchronization/object.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module Synchronization
1111
# - final instance variables see {Object.safe_initialization!}
1212
# - volatile instance variables see {Object.attr_volatile}
1313
# - volatile instance variables see {Object.attr_atomic}
14+
# @!visibility private
1415
class Object < AbstractObject
1516
include Volatile
1617

lib/concurrent-ruby/concurrent/synchronization/volatile.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ module Synchronization
2323
# => 1
2424
# foo.bar = 2
2525
# => 2
26-
26+
#
27+
# @!visibility private
2728
module Volatile
2829
def self.included(base)
2930
base.extend(ClassMethods)

lib/concurrent-ruby/concurrent/tvar.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ def leave_transaction
149149

150150
private
151151

152+
# @!visibility private
152153
class Transaction
153154

154155
ABORTED = ::Object.new

lib/concurrent-ruby/concurrent/utility/engine.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module Concurrent
2+
# @!visibility private
23
module Utility
34

45
# @!visibility private

lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
require 'concurrent/synchronization/abstract_object'
44

55
module Concurrent
6+
# @!visibility private
67
module Utility
78
# @!visibility private
89
module NativeExtensionLoader

lib/concurrent-ruby/concurrent/utility/native_integer.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module Concurrent
2+
# @!visibility private
23
module Utility
34
# @private
45
module NativeInteger

lib/concurrent-ruby/concurrent/utility/processor_counter.rb

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
require 'concurrent/delay'
44

55
module Concurrent
6+
# @!visibility private
67
module Utility
78

89
# @!visibility private
@@ -12,43 +13,10 @@ def initialize
1213
@physical_processor_count = Delay.new { compute_physical_processor_count }
1314
end
1415

15-
# Number of processors seen by the OS and used for process scheduling. For
16-
# performance reasons the calculated value will be memoized on the first
17-
# call.
18-
#
19-
# When running under JRuby the Java runtime call
20-
# `java.lang.Runtime.getRuntime.availableProcessors` will be used. According
21-
# to the Java documentation this "value may change during a particular
22-
# invocation of the virtual machine... [applications] should therefore
23-
# occasionally poll this property." Subsequently the result will NOT be
24-
# memoized under JRuby.
25-
#
26-
# Otherwise Ruby's Etc.nprocessors will be used.
27-
#
28-
# @return [Integer] number of processors seen by the OS or Java runtime
29-
#
30-
# @see http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html#availableProcessors()
3116
def processor_count
3217
@processor_count.value
3318
end
3419

35-
# Number of physical processor cores on the current system. For performance
36-
# reasons the calculated value will be memoized on the first call.
37-
#
38-
# On Windows the Win32 API will be queried for the `NumberOfCores from
39-
# Win32_Processor`. This will return the total number "of cores for the
40-
# current instance of the processor." On Unix-like operating systems either
41-
# the `hwprefs` or `sysctl` utility will be called in a subshell and the
42-
# returned value will be used. In the rare case where none of these methods
43-
# work or an exception is raised the function will simply return 1.
44-
#
45-
# @return [Integer] number physical processor cores on the current system
46-
#
47-
# @see https://github.com/grosser/parallel/blob/4fc8b89d08c7091fe0419ca8fba1ec3ce5a8d185/lib/parallel.rb
48-
#
49-
# @see http://msdn.microsoft.com/en-us/library/aa394373(v=vs.85).aspx
50-
# @see http://www.unix.com/man-page/osx/1/HWPREFS/
51-
# @see http://linux.die.net/man/8/sysctl
5220
def physical_processor_count
5321
@physical_processor_count.value
5422
end
@@ -99,10 +67,43 @@ def compute_physical_processor_count
9967
@processor_counter = Utility::ProcessorCounter.new
10068
singleton_class.send :attr_reader, :processor_counter
10169

70+
# Number of processors seen by the OS and used for process scheduling. For
71+
# performance reasons the calculated value will be memoized on the first
72+
# call.
73+
#
74+
# When running under JRuby the Java runtime call
75+
# `java.lang.Runtime.getRuntime.availableProcessors` will be used. According
76+
# to the Java documentation this "value may change during a particular
77+
# invocation of the virtual machine... [applications] should therefore
78+
# occasionally poll this property." Subsequently the result will NOT be
79+
# memoized under JRuby.
80+
#
81+
# Otherwise Ruby's Etc.nprocessors will be used.
82+
#
83+
# @return [Integer] number of processors seen by the OS or Java runtime
84+
#
85+
# @see http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html#availableProcessors()
10286
def self.processor_count
10387
processor_counter.processor_count
10488
end
10589

90+
# Number of physical processor cores on the current system. For performance
91+
# reasons the calculated value will be memoized on the first call.
92+
#
93+
# On Windows the Win32 API will be queried for the `NumberOfCores from
94+
# Win32_Processor`. This will return the total number "of cores for the
95+
# current instance of the processor." On Unix-like operating systems either
96+
# the `hwprefs` or `sysctl` utility will be called in a subshell and the
97+
# returned value will be used. In the rare case where none of these methods
98+
# work or an exception is raised the function will simply return 1.
99+
#
100+
# @return [Integer] number physical processor cores on the current system
101+
#
102+
# @see https://github.com/grosser/parallel/blob/4fc8b89d08c7091fe0419ca8fba1ec3ce5a8d185/lib/parallel.rb
103+
#
104+
# @see http://msdn.microsoft.com/en-us/library/aa394373(v=vs.85).aspx
105+
# @see http://www.unix.com/man-page/osx/1/HWPREFS/
106+
# @see http://linux.die.net/man/8/sysctl
106107
def self.physical_processor_count
107108
processor_counter.physical_processor_count
108109
end

0 commit comments

Comments
 (0)