This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +1
-108
lines changed Expand file tree Collapse file tree 4 files changed +1
-108
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,6 @@ Style/EvalWithLocation:
19
19
# eval is only used here to check syntax
20
20
- ' lib/rspec/support/ruby_features.rb'
21
21
22
- Lint/AssignmentInCondition :
23
- Exclude :
24
- # The pattern makes sense here
25
- - ' lib/rspec/support/mutex.rb'
26
-
27
22
# Over time we'd like to get this down, but this is what we're at now.
28
23
Metrics/AbcSize :
29
24
Max : 22
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -6,16 +6,12 @@ module Support
6
6
# Based on Monitor as of 2.2 -
7
7
# https://github.com/ruby/ruby/blob/eb7ddaa3a47bf48045d26c72eb0f263a53524ebc/lib/monitor.rb#L9
8
8
#
9
- # Depends on Mutex, but Mutex is only available as part of core since 1.9.1:
10
- # exists - http://ruby-doc.org/core-1.9.1/Mutex.html
11
- # dne - http://ruby-doc.org/core-1.9.0/Mutex.html
12
- #
13
9
# @private
14
10
class ReentrantMutex
15
11
def initialize
16
12
@owner = nil
17
13
@count = 0
18
- @mutex = Mutex . new
14
+ @mutex = Thread :: Mutex . new
19
15
end
20
16
21
17
def synchronize
@@ -40,22 +36,5 @@ def exit
40
36
@mutex . unlock
41
37
end
42
38
end
43
-
44
- if defined? ::Mutex
45
- # On 1.9 and up, this is in core, so we just use the real one
46
- class Mutex < ::Mutex
47
- # If you mock Mutex.new you break our usage of Mutex, so
48
- # instead we capture the original method to return Mutexs.
49
- NEW_MUTEX_METHOD = Mutex . method ( :new )
50
-
51
- def self . new
52
- NEW_MUTEX_METHOD . call
53
- end
54
- end
55
- else # For 1.8.7
56
- # :nocov:
57
- RSpec ::Support . require_rspec_support "mutex"
58
- # :nocov:
59
- end
60
39
end
61
40
end
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments