@@ -247,7 +247,7 @@ def method_missing(method, *args, &block)
247
247
#
248
248
# @see Concurrent::Future
249
249
def async
250
- raise InitializationError . new ( '#init_mutex was never called' ) unless @mutex
250
+ raise InitializationError . new ( '#init_mutex was never called' ) unless @__async__mutex__
251
251
@__async_delegator__ . value
252
252
end
253
253
alias_method :future , :async
@@ -281,7 +281,7 @@ def async
281
281
#
282
282
# @see Concurrent::IVar
283
283
def await
284
- raise InitializationError . new ( '#init_mutex was never called' ) unless @mutex
284
+ raise InitializationError . new ( '#init_mutex was never called' ) unless @__async__mutex__
285
285
@__await_delegator__ . value
286
286
end
287
287
alias_method :delay , :await
@@ -291,7 +291,7 @@ def await
291
291
# @raise [Concurrent::InitializationError] `#init_mutex` has not been called
292
292
# @raise [ArgumentError] executor has already been set
293
293
def executor = ( executor )
294
- raise InitializationError . new ( '#init_mutex was never called' ) unless @mutex
294
+ raise InitializationError . new ( '#init_mutex was never called' ) unless @__async__mutex__
295
295
@__async__executor__ . reconfigure { executor } or
296
296
raise ArgumentError . new ( 'executor has already been set' )
297
297
end
@@ -309,12 +309,12 @@ def executor=(executor)
309
309
#
310
310
# @raise [Concurrent::InitializationError] when called more than once
311
311
def init_mutex
312
- raise InitializationError . new ( '#init_mutex was already called' ) if @mutex
313
- ( @mutex = Mutex . new ) . lock
312
+ raise InitializationError . new ( '#init_mutex was already called' ) if @__async__mutex__
313
+ ( @__async__mutex__ = Mutex . new ) . lock
314
314
@__async__executor__ = Delay . new { Concurrent . configuration . global_operation_pool }
315
- @__await_delegator__ = Delay . new { AwaitDelegator . new ( self , @mutex ) }
316
- @__async_delegator__ = Delay . new { AsyncDelegator . new ( self , @__async__executor__ , @mutex ) }
317
- @mutex . unlock
315
+ @__await_delegator__ = Delay . new { AwaitDelegator . new ( self , @__async__mutex__ ) }
316
+ @__async_delegator__ = Delay . new { AsyncDelegator . new ( self , @__async__executor__ , @__async__mutex__ ) }
317
+ @__async__mutex__ . unlock
318
318
end
319
319
end
320
320
end
0 commit comments