smart_engine 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -0
- data/lib/smart_core/engine/read_write_lock.rb +9 -0
- data/lib/smart_core/engine/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 571c427f764fe322ccc465dbe90d760ffde9ffa324bd55a15e6046da6a18909f
|
4
|
+
data.tar.gz: 446a429d3c440bfa0bc1bc16a3abdb58289810d56bd7eec86b66307c59c5227a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3493139baf67304edaa0fd7db320987b6ed860efc2d80e393a1baa73d590cd0b63e80e0069430bc3d286f7bcf095161ea51782643792ce0a4f3b8dca4e5e9ce5
|
7
|
+
data.tar.gz: 7702c746ab952d345e935a40a51d581f8f2ecb81f8f12c867e295813e74df9f08bd7b7db31b644194fe6e5e428026577c33de2e17e37a1287c2f6dd42781a20e
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## [0.15.0] - 2022-09-30
|
5
|
+
### Added
|
6
|
+
- `SmartCore::Engine::ReadWriteLock#write_owned?` - checking that write lock is owned by current thread or not;
|
7
|
+
|
4
8
|
## [0.14.0] - 2022-09-30
|
5
9
|
### Added
|
6
10
|
- Read/Write locking mechanizm: `SmartCore::Engine::ReadWriteLock`;
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -76,6 +76,9 @@ lock = SmartCore::Engine::ReadWriteLock.new
|
|
76
76
|
lock.read_sync { ...some-read-op... } # waits for writer
|
77
77
|
lock.read_sync { ...some-read-op... } # waits for writer
|
78
78
|
lock.write_sync { ... some-write-op... } # waits for all readers and current writer
|
79
|
+
|
80
|
+
# is write_sync lock is owned by current thread?
|
81
|
+
lock.write_owned? # true or false
|
79
82
|
```
|
80
83
|
|
81
84
|
---
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
# @api public
|
4
4
|
# @since 0.14.0
|
5
|
+
# @version 0.15.0
|
5
6
|
class SmartCore::Engine::ReadWriteLock
|
6
7
|
# @return [void]
|
7
8
|
#
|
@@ -28,6 +29,14 @@ class SmartCore::Engine::ReadWriteLock
|
|
28
29
|
@active_reader = false
|
29
30
|
end
|
30
31
|
|
32
|
+
# @return [Boolean]
|
33
|
+
#
|
34
|
+
# @api public
|
35
|
+
# @since 0.15.0
|
36
|
+
def write_owned?
|
37
|
+
@write_lock.owned?
|
38
|
+
end
|
39
|
+
|
31
40
|
# @param block [Block]
|
32
41
|
# @return [Any]
|
33
42
|
#
|