rbs 2.0.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/comments.yml +34 -0
- data/.github/workflows/ruby.yml +5 -0
- data/CHANGELOG.md +82 -0
- data/README.md +6 -1
- data/Rakefile +56 -21
- data/core/array.rbs +2866 -1086
- data/core/basic_object.rbs +150 -30
- data/core/binding.rbs +33 -0
- data/core/builtin.rbs +4 -4
- data/core/class.rbs +43 -5
- data/core/comparable.rbs +57 -0
- data/core/complex.rbs +170 -4
- data/core/constants.rbs +51 -0
- data/core/deprecated.rbs +7 -0
- data/core/dir.rbs +305 -20
- data/core/encoding.rbs +1214 -77
- data/core/enumerable.rbs +2173 -234
- data/core/enumerator.rbs +448 -182
- data/core/env.rbs +448 -1
- data/core/errno.rbs +1 -10
- data/core/errors.rbs +152 -2
- data/core/exception.rbs +201 -127
- data/core/false_class.rbs +27 -0
- data/core/fiber.rbs +118 -37
- data/core/fiber_error.rbs +8 -9
- data/core/file.rbs +1060 -142
- data/core/file_test.rbs +287 -32
- data/core/float.rbs +776 -300
- data/core/gc.rbs +185 -34
- data/core/global_variables.rbs +5 -1
- data/core/hash.rbs +1582 -649
- data/core/integer.rbs +974 -204
- data/core/io/buffer.rbs +710 -0
- data/core/io/wait.rbs +29 -8
- data/core/io.rbs +2438 -417
- data/core/kernel.rbs +2319 -318
- data/core/marshal.rbs +37 -2
- data/core/match_data.rbs +123 -6
- data/core/math.rbs +126 -6
- data/core/method.rbs +226 -102
- data/core/module.rbs +421 -45
- data/core/nil_class.rbs +64 -0
- data/core/numeric.rbs +620 -142
- data/core/object.rbs +453 -81
- data/core/object_space.rbs +92 -2
- data/core/proc.rbs +482 -285
- data/core/process.rbs +443 -34
- data/core/ractor.rbs +232 -9
- data/core/random.rbs +151 -52
- data/core/range.rbs +885 -160
- data/core/rational.rbs +122 -6
- data/core/rb_config.rbs +14 -4
- data/core/refinement.rbs +44 -0
- data/core/regexp.rbs +156 -14
- data/core/ruby_vm.rbs +42 -3
- data/core/signal.rbs +78 -39
- data/core/string.rbs +2123 -567
- data/core/string_io.rbs +204 -0
- data/core/struct.rbs +283 -28
- data/core/symbol.rbs +304 -30
- data/core/thread.rbs +1288 -688
- data/core/thread_group.rbs +66 -10
- data/core/time.rbs +643 -217
- data/core/trace_point.rbs +100 -12
- data/core/true_class.rbs +24 -0
- data/core/unbound_method.rbs +73 -7
- data/core/warning.rbs +37 -12
- data/docs/CONTRIBUTING.md +40 -34
- data/docs/stdlib.md +3 -102
- data/docs/syntax.md +54 -11
- data/ext/rbs_extension/extconf.rb +1 -0
- data/ext/rbs_extension/lexer.h +5 -0
- data/ext/rbs_extension/lexstate.c +6 -0
- data/ext/rbs_extension/parser.c +85 -10
- data/ext/rbs_extension/ruby_objs.c +4 -2
- data/ext/rbs_extension/ruby_objs.h +2 -2
- data/goodcheck.yml +0 -11
- data/lib/rbs/annotate/annotations.rb +197 -0
- data/lib/rbs/annotate/formatter.rb +80 -0
- data/lib/rbs/annotate/rdoc_annotator.rb +398 -0
- data/lib/rbs/annotate/rdoc_source.rb +120 -0
- data/lib/rbs/annotate.rb +6 -0
- data/lib/rbs/ast/members.rb +21 -13
- data/lib/rbs/buffer.rb +17 -11
- data/lib/rbs/cli.rb +48 -1
- data/lib/rbs/definition_builder/method_builder.rb +28 -16
- data/lib/rbs/definition_builder.rb +6 -2
- data/lib/rbs/environment.rb +8 -4
- data/lib/rbs/location_aux.rb +12 -0
- data/lib/rbs/namespace.rb +1 -1
- data/lib/rbs/prototype/rb.rb +12 -0
- data/lib/rbs/type_alias_regularity.rb +6 -4
- data/lib/rbs/type_name.rb +1 -1
- data/lib/rbs/types.rb +1 -1
- data/lib/rbs/validator.rb +6 -0
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/writer.rb +54 -4
- data/lib/rbs.rb +0 -2
- data/schema/typeParam.json +3 -3
- data/sig/annotate/annotations.rbs +102 -0
- data/sig/annotate/formatter.rbs +24 -0
- data/sig/annotate/rdoc_annotater.rbs +82 -0
- data/sig/annotate/rdoc_source.rbs +30 -0
- data/sig/buffer.rbs +6 -2
- data/sig/cli.rbs +2 -0
- data/sig/collection/{collections.rbs → sources.rbs} +0 -0
- data/sig/location.rbs +6 -0
- data/sig/members.rbs +24 -18
- data/sig/method_builder.rbs +5 -4
- data/sig/method_types.rbs +5 -1
- data/sig/polyfill.rbs +78 -0
- data/sig/validator.rbs +3 -1
- data/sig/writer.rbs +79 -2
- data/stdlib/abbrev/0/abbrev.rbs +6 -0
- data/stdlib/abbrev/0/array.rbs +26 -0
- data/stdlib/base64/0/base64.rbs +31 -0
- data/stdlib/benchmark/0/benchmark.rbs +74 -3
- data/stdlib/bigdecimal/0/big_decimal.rbs +614 -165
- data/stdlib/bigdecimal-math/0/big_math.rbs +41 -64
- data/stdlib/cgi/0/core.rbs +649 -21
- data/stdlib/coverage/0/coverage.rbs +164 -2
- data/stdlib/csv/0/csv.rbs +2862 -398
- data/stdlib/date/0/date.rbs +483 -25
- data/stdlib/date/0/date_time.rbs +187 -12
- data/stdlib/dbm/0/dbm.rbs +152 -17
- data/stdlib/digest/0/digest.rbs +146 -0
- data/stdlib/erb/0/erb.rbs +65 -245
- data/stdlib/fiber/0/fiber.rbs +73 -91
- data/stdlib/fileutils/0/fileutils.rbs +301 -1
- data/stdlib/find/0/find.rbs +9 -0
- data/stdlib/forwardable/0/forwardable.rbs +65 -1
- data/stdlib/io-console/0/io-console.rbs +227 -15
- data/stdlib/ipaddr/0/ipaddr.rbs +161 -0
- data/stdlib/json/0/json.rbs +1147 -145
- data/stdlib/logger/0/formatter.rbs +24 -0
- data/stdlib/logger/0/log_device.rbs +64 -0
- data/stdlib/logger/0/logger.rbs +165 -13
- data/stdlib/logger/0/period.rbs +10 -0
- data/stdlib/logger/0/severity.rbs +26 -0
- data/stdlib/monitor/0/monitor.rbs +163 -0
- data/stdlib/mutex_m/0/mutex_m.rbs +35 -6
- data/stdlib/net-http/0/manifest.yaml +1 -0
- data/stdlib/net-http/0/net-http.rbs +1513 -683
- data/stdlib/nkf/0/nkf.rbs +372 -0
- data/stdlib/objspace/0/objspace.rbs +149 -90
- data/stdlib/openssl/0/openssl.rbs +8108 -71
- data/stdlib/optparse/0/optparse.rbs +487 -19
- data/stdlib/pathname/0/pathname.rbs +425 -124
- data/stdlib/prettyprint/0/prettyprint.rbs +120 -99
- data/stdlib/prime/0/integer-extension.rbs +20 -2
- data/stdlib/prime/0/prime.rbs +88 -21
- data/stdlib/pstore/0/pstore.rbs +102 -0
- data/stdlib/pty/0/pty.rbs +64 -14
- data/stdlib/resolv/0/resolv.rbs +420 -31
- data/stdlib/rubygems/0/basic_specification.rbs +4 -1
- data/stdlib/rubygems/0/config_file.rbs +33 -1
- data/stdlib/rubygems/0/dependency_installer.rbs +4 -3
- data/stdlib/rubygems/0/installer.rbs +13 -1
- data/stdlib/rubygems/0/path_support.rbs +4 -1
- data/stdlib/rubygems/0/platform.rbs +5 -1
- data/stdlib/rubygems/0/request_set.rbs +44 -2
- data/stdlib/rubygems/0/requirement.rbs +65 -2
- data/stdlib/rubygems/0/rubygems.rbs +407 -0
- data/stdlib/rubygems/0/source_list.rbs +13 -0
- data/stdlib/rubygems/0/specification.rbs +21 -1
- data/stdlib/rubygems/0/stream_ui.rbs +3 -1
- data/stdlib/rubygems/0/uninstaller.rbs +8 -1
- data/stdlib/rubygems/0/version.rbs +60 -157
- data/stdlib/securerandom/0/securerandom.rbs +44 -0
- data/stdlib/set/0/set.rbs +423 -109
- data/stdlib/shellwords/0/shellwords.rbs +55 -77
- data/stdlib/singleton/0/singleton.rbs +20 -0
- data/stdlib/socket/0/addrinfo.rbs +210 -9
- data/stdlib/socket/0/basic_socket.rbs +103 -11
- data/stdlib/socket/0/ip_socket.rbs +31 -9
- data/stdlib/socket/0/socket.rbs +586 -38
- data/stdlib/socket/0/tcp_server.rbs +22 -2
- data/stdlib/socket/0/tcp_socket.rbs +12 -1
- data/stdlib/socket/0/udp_socket.rbs +25 -2
- data/stdlib/socket/0/unix_server.rbs +22 -2
- data/stdlib/socket/0/unix_socket.rbs +45 -5
- data/stdlib/strscan/0/string_scanner.rbs +210 -9
- data/stdlib/tempfile/0/tempfile.rbs +58 -10
- data/stdlib/time/0/time.rbs +208 -116
- data/stdlib/timeout/0/timeout.rbs +10 -0
- data/stdlib/tmpdir/0/tmpdir.rbs +13 -4
- data/stdlib/tsort/0/cyclic.rbs +1 -0
- data/stdlib/tsort/0/interfaces.rbs +1 -0
- data/stdlib/tsort/0/tsort.rbs +42 -0
- data/stdlib/uri/0/common.rbs +57 -8
- data/stdlib/uri/0/file.rbs +55 -109
- data/stdlib/uri/0/ftp.rbs +6 -3
- data/stdlib/uri/0/generic.rbs +558 -329
- data/stdlib/uri/0/http.rbs +60 -114
- data/stdlib/uri/0/https.rbs +8 -102
- data/stdlib/uri/0/ldap.rbs +143 -137
- data/stdlib/uri/0/ldaps.rbs +8 -102
- data/stdlib/uri/0/mailto.rbs +3 -0
- data/stdlib/uri/0/rfc2396_parser.rbs +66 -26
- data/stdlib/uri/0/ws.rbs +6 -3
- data/stdlib/uri/0/wss.rbs +5 -3
- data/stdlib/yaml/0/dbm.rbs +151 -87
- data/stdlib/yaml/0/store.rbs +6 -0
- data/stdlib/zlib/0/zlib.rbs +90 -31
- metadata +18 -6
- data/lib/rbs/location.rb +0 -221
- data/sig/char_scanner.rbs +0 -9
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# <!-- rdoc-file=ext/monitor/lib/monitor.rb -->
|
|
1
2
|
# Use the Monitor class when you want to have a lock object for blocks with
|
|
2
3
|
# mutual exclusion.
|
|
3
4
|
#
|
|
@@ -7,113 +8,275 @@
|
|
|
7
8
|
# lock.synchronize do
|
|
8
9
|
# # exclusive access
|
|
9
10
|
# end
|
|
11
|
+
#
|
|
10
12
|
class Monitor
|
|
11
13
|
public
|
|
12
14
|
|
|
15
|
+
# <!--
|
|
16
|
+
# rdoc-file=ext/monitor/monitor.c
|
|
17
|
+
# - enter()
|
|
18
|
+
# -->
|
|
19
|
+
#
|
|
13
20
|
def enter: () -> nil
|
|
14
21
|
|
|
22
|
+
# <!--
|
|
23
|
+
# rdoc-file=ext/monitor/monitor.c
|
|
24
|
+
# - exit()
|
|
25
|
+
# -->
|
|
26
|
+
#
|
|
15
27
|
def exit: () -> nil
|
|
16
28
|
|
|
29
|
+
# <!--
|
|
30
|
+
# rdoc-file=ext/monitor/monitor.c
|
|
31
|
+
# - mon_check_owner()
|
|
32
|
+
# -->
|
|
33
|
+
#
|
|
17
34
|
def mon_check_owner: () -> nil
|
|
18
35
|
|
|
36
|
+
# <!--
|
|
37
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
38
|
+
# - mon_enter()
|
|
39
|
+
# -->
|
|
40
|
+
#
|
|
19
41
|
alias mon_enter enter
|
|
20
42
|
|
|
43
|
+
# <!--
|
|
44
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
45
|
+
# - mon_exit()
|
|
46
|
+
# -->
|
|
47
|
+
#
|
|
21
48
|
alias mon_exit exit
|
|
22
49
|
|
|
50
|
+
# <!--
|
|
51
|
+
# rdoc-file=ext/monitor/monitor.c
|
|
52
|
+
# - mon_locked?()
|
|
53
|
+
# -->
|
|
54
|
+
#
|
|
23
55
|
def mon_locked?: () -> bool
|
|
24
56
|
|
|
57
|
+
# <!--
|
|
58
|
+
# rdoc-file=ext/monitor/monitor.c
|
|
59
|
+
# - mon_owned?()
|
|
60
|
+
# -->
|
|
61
|
+
#
|
|
25
62
|
def mon_owned?: () -> bool
|
|
26
63
|
|
|
64
|
+
# <!--
|
|
65
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
66
|
+
# - mon_synchronize()
|
|
67
|
+
# -->
|
|
68
|
+
#
|
|
27
69
|
alias mon_synchronize synchronize
|
|
28
70
|
|
|
71
|
+
# <!--
|
|
72
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
73
|
+
# - mon_try_enter()
|
|
74
|
+
# -->
|
|
75
|
+
#
|
|
29
76
|
alias mon_try_enter try_enter
|
|
30
77
|
|
|
78
|
+
# <!--
|
|
79
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
80
|
+
# - new_cond()
|
|
81
|
+
# -->
|
|
82
|
+
#
|
|
31
83
|
def new_cond: () -> ::MonitorMixin::ConditionVariable
|
|
32
84
|
|
|
85
|
+
# <!--
|
|
86
|
+
# rdoc-file=ext/monitor/monitor.c
|
|
87
|
+
# - synchronize()
|
|
88
|
+
# -->
|
|
89
|
+
#
|
|
33
90
|
def synchronize: [T] () { () -> T } -> T
|
|
34
91
|
|
|
92
|
+
# <!--
|
|
93
|
+
# rdoc-file=ext/monitor/monitor.c
|
|
94
|
+
# - try_enter()
|
|
95
|
+
# -->
|
|
96
|
+
#
|
|
35
97
|
def try_enter: () -> bool
|
|
36
98
|
|
|
99
|
+
# <!-- rdoc-file=ext/monitor/lib/monitor.rb -->
|
|
37
100
|
# for compatibility
|
|
101
|
+
#
|
|
38
102
|
alias try_mon_enter try_enter
|
|
39
103
|
|
|
104
|
+
# <!--
|
|
105
|
+
# rdoc-file=ext/monitor/monitor.c
|
|
106
|
+
# - wait_for_cond(p1, p2)
|
|
107
|
+
# -->
|
|
108
|
+
#
|
|
40
109
|
def wait_for_cond: (::MonitorMixin::ConditionVariable, Numeric? timeout) -> untyped
|
|
41
110
|
end
|
|
42
111
|
|
|
43
112
|
module MonitorMixin
|
|
113
|
+
# <!--
|
|
114
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
115
|
+
# - extend_object(obj)
|
|
116
|
+
# -->
|
|
117
|
+
#
|
|
44
118
|
def self.extend_object: (untyped obj) -> untyped
|
|
45
119
|
|
|
46
120
|
public
|
|
47
121
|
|
|
122
|
+
# <!--
|
|
123
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
124
|
+
# - mon_enter()
|
|
125
|
+
# -->
|
|
48
126
|
# Enters exclusive section.
|
|
127
|
+
#
|
|
49
128
|
def mon_enter: () -> nil
|
|
50
129
|
|
|
130
|
+
# <!--
|
|
131
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
132
|
+
# - mon_exit()
|
|
133
|
+
# -->
|
|
51
134
|
# Leaves exclusive section.
|
|
135
|
+
#
|
|
52
136
|
def mon_exit: () -> nil
|
|
53
137
|
|
|
138
|
+
# <!--
|
|
139
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
140
|
+
# - mon_locked?()
|
|
141
|
+
# -->
|
|
54
142
|
# Returns true if this monitor is locked by any thread
|
|
143
|
+
#
|
|
55
144
|
def mon_locked?: () -> bool
|
|
56
145
|
|
|
146
|
+
# <!--
|
|
147
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
148
|
+
# - mon_owned?()
|
|
149
|
+
# -->
|
|
57
150
|
# Returns true if this monitor is locked by current thread.
|
|
151
|
+
#
|
|
58
152
|
def mon_owned?: () -> bool
|
|
59
153
|
|
|
154
|
+
# <!--
|
|
155
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
156
|
+
# - mon_synchronize(&b)
|
|
157
|
+
# -->
|
|
60
158
|
# Enters exclusive section and executes the block. Leaves the exclusive section
|
|
61
159
|
# automatically when the block exits. See example under `MonitorMixin`.
|
|
160
|
+
#
|
|
62
161
|
def mon_synchronize: [T] () { () -> T } -> T
|
|
63
162
|
|
|
163
|
+
# <!--
|
|
164
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
165
|
+
# - mon_try_enter()
|
|
166
|
+
# -->
|
|
64
167
|
# Attempts to enter exclusive section. Returns `false` if lock fails.
|
|
168
|
+
#
|
|
65
169
|
def mon_try_enter: () -> bool
|
|
66
170
|
|
|
171
|
+
# <!--
|
|
172
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
173
|
+
# - new_cond()
|
|
174
|
+
# -->
|
|
67
175
|
# Creates a new MonitorMixin::ConditionVariable associated with the Monitor
|
|
68
176
|
# object.
|
|
177
|
+
#
|
|
69
178
|
def new_cond: () -> ::MonitorMixin::ConditionVariable
|
|
70
179
|
|
|
180
|
+
# <!--
|
|
181
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
182
|
+
# - synchronize(&b)
|
|
183
|
+
# -->
|
|
184
|
+
#
|
|
71
185
|
alias synchronize mon_synchronize
|
|
72
186
|
|
|
187
|
+
# <!-- rdoc-file=ext/monitor/lib/monitor.rb -->
|
|
73
188
|
# For backward compatibility
|
|
189
|
+
#
|
|
74
190
|
alias try_mon_enter mon_try_enter
|
|
75
191
|
|
|
76
192
|
private
|
|
77
193
|
|
|
194
|
+
# <!--
|
|
195
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
196
|
+
# - new(...)
|
|
197
|
+
# -->
|
|
78
198
|
# Use `extend MonitorMixin` or `include MonitorMixin` instead of this
|
|
79
199
|
# constructor. Have look at the examples above to understand how to use this
|
|
80
200
|
# module.
|
|
201
|
+
#
|
|
81
202
|
def initialize: (*untyped) { (*untyped) -> untyped } -> void
|
|
82
203
|
|
|
204
|
+
# <!--
|
|
205
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
206
|
+
# - mon_check_owner()
|
|
207
|
+
# -->
|
|
208
|
+
#
|
|
83
209
|
def mon_check_owner: () -> nil
|
|
84
210
|
|
|
211
|
+
# <!--
|
|
212
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
213
|
+
# - mon_initialize()
|
|
214
|
+
# -->
|
|
85
215
|
# Initializes the MonitorMixin after being included in a class or when an object
|
|
86
216
|
# has been extended with the MonitorMixin
|
|
217
|
+
#
|
|
87
218
|
def mon_initialize: () -> untyped
|
|
88
219
|
end
|
|
89
220
|
|
|
221
|
+
# <!-- rdoc-file=ext/monitor/lib/monitor.rb -->
|
|
90
222
|
# FIXME: This isn't documented in Nutshell.
|
|
91
223
|
#
|
|
92
224
|
# Since MonitorMixin.new_cond returns a ConditionVariable, and the example above
|
|
93
225
|
# calls while_wait and signal, this class should be documented.
|
|
226
|
+
#
|
|
94
227
|
class MonitorMixin::ConditionVariable
|
|
95
228
|
public
|
|
96
229
|
|
|
230
|
+
# <!--
|
|
231
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
232
|
+
# - broadcast()
|
|
233
|
+
# -->
|
|
97
234
|
# Wakes up all threads waiting for this lock.
|
|
235
|
+
#
|
|
98
236
|
def broadcast: () -> Thread::ConditionVariable
|
|
99
237
|
|
|
238
|
+
# <!--
|
|
239
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
240
|
+
# - signal()
|
|
241
|
+
# -->
|
|
100
242
|
# Wakes up the first thread in line waiting for this lock.
|
|
243
|
+
#
|
|
101
244
|
def signal: () -> Thread::ConditionVariable
|
|
102
245
|
|
|
246
|
+
# <!--
|
|
247
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
248
|
+
# - wait(timeout = nil)
|
|
249
|
+
# -->
|
|
103
250
|
# Releases the lock held in the associated monitor and waits; reacquires the
|
|
104
251
|
# lock on wakeup.
|
|
105
252
|
#
|
|
106
253
|
# If `timeout` is given, this method returns after `timeout` seconds passed,
|
|
107
254
|
# even if no other thread doesn't signal.
|
|
255
|
+
#
|
|
108
256
|
def wait: (?Numeric? timeout) -> untyped
|
|
109
257
|
|
|
258
|
+
# <!--
|
|
259
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
260
|
+
# - wait_until()
|
|
261
|
+
# -->
|
|
110
262
|
# Calls wait repeatedly until the given block yields a truthy value.
|
|
263
|
+
#
|
|
111
264
|
def wait_until: () { () -> boolish } -> untyped
|
|
112
265
|
|
|
266
|
+
# <!--
|
|
267
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
268
|
+
# - wait_while()
|
|
269
|
+
# -->
|
|
113
270
|
# Calls wait repeatedly while the given block yields a truthy value.
|
|
271
|
+
#
|
|
114
272
|
def wait_while: () { () -> boolish } -> untyped
|
|
115
273
|
|
|
116
274
|
private
|
|
117
275
|
|
|
276
|
+
# <!--
|
|
277
|
+
# rdoc-file=ext/monitor/lib/monitor.rb
|
|
278
|
+
# - new(monitor)
|
|
279
|
+
# -->
|
|
280
|
+
#
|
|
118
281
|
def initialize: (Monitor monitor) -> void
|
|
119
282
|
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# <!-- rdoc-file=lib/mutex_m.rb -->
|
|
1
2
|
# # mutex_m.rb
|
|
2
3
|
#
|
|
3
4
|
# When 'mutex_m' is required, any object that extends or includes Mutex_m will
|
|
@@ -37,34 +38,62 @@ module Mutex_m
|
|
|
37
38
|
|
|
38
39
|
def mu_extended: () -> untyped
|
|
39
40
|
|
|
40
|
-
#
|
|
41
|
+
# <!--
|
|
42
|
+
# rdoc-file=lib/mutex_m.rb
|
|
43
|
+
# - mu_lock()
|
|
44
|
+
# -->
|
|
45
|
+
# See Thread::Mutex#lock
|
|
41
46
|
#
|
|
42
47
|
def mu_lock: () -> Thread::Mutex
|
|
43
48
|
|
|
44
|
-
#
|
|
49
|
+
# <!--
|
|
50
|
+
# rdoc-file=lib/mutex_m.rb
|
|
51
|
+
# - mu_locked?()
|
|
52
|
+
# -->
|
|
53
|
+
# See Thread::Mutex#locked?
|
|
45
54
|
#
|
|
46
55
|
def mu_locked?: () -> bool
|
|
47
56
|
|
|
48
|
-
#
|
|
57
|
+
# <!--
|
|
58
|
+
# rdoc-file=lib/mutex_m.rb
|
|
59
|
+
# - mu_synchronize(&block)
|
|
60
|
+
# -->
|
|
61
|
+
# See Thread::Mutex#synchronize
|
|
49
62
|
#
|
|
50
63
|
def mu_synchronize: [T] () { () -> T } -> T
|
|
51
64
|
|
|
52
|
-
#
|
|
65
|
+
# <!--
|
|
66
|
+
# rdoc-file=lib/mutex_m.rb
|
|
67
|
+
# - mu_try_lock()
|
|
68
|
+
# -->
|
|
69
|
+
# See Thread::Mutex#try_lock
|
|
53
70
|
#
|
|
54
71
|
def mu_try_lock: () -> bool
|
|
55
72
|
|
|
56
|
-
#
|
|
73
|
+
# <!--
|
|
74
|
+
# rdoc-file=lib/mutex_m.rb
|
|
75
|
+
# - mu_unlock()
|
|
76
|
+
# -->
|
|
77
|
+
# See Thread::Mutex#unlock
|
|
57
78
|
#
|
|
58
79
|
def mu_unlock: () -> Thread::Mutex
|
|
59
80
|
|
|
60
|
-
#
|
|
81
|
+
# <!--
|
|
82
|
+
# rdoc-file=lib/mutex_m.rb
|
|
83
|
+
# - sleep(timeout = nil)
|
|
84
|
+
# -->
|
|
85
|
+
# See Thread::Mutex#sleep
|
|
61
86
|
#
|
|
62
87
|
def sleep: (?Numeric timeout) -> Integer?
|
|
63
88
|
|
|
64
89
|
alias locked? mu_locked?
|
|
90
|
+
|
|
65
91
|
alias lock mu_lock
|
|
92
|
+
|
|
66
93
|
alias unlock mu_unlock
|
|
94
|
+
|
|
67
95
|
alias try_lock mu_try_lock
|
|
96
|
+
|
|
68
97
|
alias synchronize mu_synchronize
|
|
69
98
|
|
|
70
99
|
private
|