priority_mutex 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/VERSION +1 -1
  3. data/lib/priority_mutex.rb +4 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- N2E0OTMwYzJiYmE5M2E5Y2ZjYzhlZTlkZWVlOGZiNTc5YjA1M2IwNw==
4
+ NGRiZWMyZmJjNDY4NmM5ZGVhOWM3ODNhZTYxZTA0NGM2YTMwZWY0ZA==
5
5
  data.tar.gz: !binary |-
6
- YTJkYmZiYzM0YWE0YTg5NmE3Nzk0NGY4NTVkZGI5ZGQzZDRiMzY2NQ==
6
+ Yzc4NTcxNDZjZjFiMWQ1ODFiZjI2OGVhMDU0OGJiMjZlY2I5ODhlNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Mjc4YWYyZjI1ZDlkOWJkNmM4MWZkMzU5MDVhZjZmNzM1Mjk3ODVmZmIxOWY0
10
- YjFkYjU3N2RlODIwODMwMmQ2MDVhMzA3M2RkZjNmOGY1MzAzMTNjN2QwYWU2
11
- ZTM4Yzk1ZWVhNDBmMTI1Mzk0MDc2NDdkZjgxMWI5YjhiN2FmZjg=
9
+ NDdlNjk5MGJhYjkzZDgzZGU4YmVhNTE0MjI5M2UyOTBhNDFhMjliYmZkYWU4
10
+ MTkwYWE1NmFkYjM3NGI4NmY4NjVlZTNlNDM2ZmEyOWY1ZjU1NzU4ZDkzOWM4
11
+ NjZhYzlhNDI3NGFiMGYyZWJjZGY3MjhlNjlkMTFjZTUzNGRjZjU=
12
12
  data.tar.gz: !binary |-
13
- ZTFhMTIzNmFmNzRmMjM2ZWQyMTM4MzQzMTQ4NDlhMWZmMTk2ODBlZjc3ZDVm
14
- YjAwODYwMmY0MTE4OTVkYjEzMGIzMjgyZGFlYTliM2I3ZWE1OWI3ODhkNDg1
15
- Y2ExMDQ3MzA2NmJlNWRiODI3YTYxNmY4OTIxNWFiMDViNDYzNDU=
13
+ MjczZjRlNTQxMDQ3Zjg4NTliMTdkMjQ5ZmM0ZTk2N2UwM2MyNjUwMjhlODM1
14
+ MTU3NjYzNzFlMzBiOGM4MmM2Y2RlMGVjNGUyN2ViMDg5ZWJlODc1ZWNlMzFm
15
+ M2U1OWY2N2NiNzEzMzczMzQ2YzdiOGQ1NTUyMmEzNzJmOGM3NWU=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -44,6 +44,10 @@ class PriorityMutex
44
44
  release_resource
45
45
  end
46
46
 
47
+ def locked?
48
+ @resource_active || @pq.size > 0
49
+ end
50
+
47
51
  private
48
52
 
49
53
  def wait_for_resource_if_necessary(priority)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: priority_mutex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Jarema