priority_mutex 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/VERSION +1 -1
- data/lib/priority_mutex.rb +5 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGYxNGIzOTY3MThkYjNkY2EyMjc2MzQ5MDg0M2YxNWJjNTAwM2ZhOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmY5MzliZDUxMmVmNTczYmQ1MGQ4ZTNjOTIzNTM2NWY4ODQ0ZDQ5NQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzA3N2I2MzI1MGNmMzhiNDIyMThjOTIyZTVlN2Y3NzliNjU4MzljYWQ2NmUz
|
10
|
+
YzEzYjdiNWE0YTk0NTIzMzdlZGM0MGI3ZmFjZWZhNzE2MWJhYjA0NDlhMGVi
|
11
|
+
NWQyM2RiMWU2OTk0NjMzYjAxYmMzOTFhYzRjYjU3ZDYwYTZkNzA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjkzNzYzMTU5MDAzZjIxNTliZjczNTAxYjdlNDc5MjNkYjBmMGM5ZmViY2Ux
|
14
|
+
NjVmOGU0YWZjODg0NGQwY2E2M2IyNDQxNTRjMjU1NmUwN2Y2OWRjOGY3MWI5
|
15
|
+
ZjlkMGYzZmEyNWE2MDM1NjgyOTYzODc3NzUyZDBiYzNmNWRlZjE=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/lib/priority_mutex.rb
CHANGED
@@ -73,15 +73,12 @@ private
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def release_resource
|
76
|
-
next_waiter = nil
|
77
|
-
|
78
76
|
@pq_mutex.synchronize do
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
next_waiter.resume
|
77
|
+
if next_waiter = @pq.pop
|
78
|
+
next_waiter.resume
|
79
|
+
else
|
80
|
+
@resource_active = false
|
81
|
+
end
|
85
82
|
end
|
86
83
|
end
|
87
84
|
|