smart_engine 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 571c427f764fe322ccc465dbe90d760ffde9ffa324bd55a15e6046da6a18909f
4
- data.tar.gz: 446a429d3c440bfa0bc1bc16a3abdb58289810d56bd7eec86b66307c59c5227a
3
+ metadata.gz: f3f6a846502241aa2029b692dc4f0c81ee004527a3242b750b7c6ea10a37872a
4
+ data.tar.gz: 9bec4690bf081407fc7262610e978065f99422f57df2c1d673469d53cf6f142f
5
5
  SHA512:
6
- metadata.gz: 3493139baf67304edaa0fd7db320987b6ed860efc2d80e393a1baa73d590cd0b63e80e0069430bc3d286f7bcf095161ea51782643792ce0a4f3b8dca4e5e9ce5
7
- data.tar.gz: 7702c746ab952d345e935a40a51d581f8f2ecb81f8f12c867e295813e74df9f08bd7b7db31b644194fe6e5e428026577c33de2e17e37a1287c2f6dd42781a20e
6
+ metadata.gz: 40e93990c49475cf764d2baf118f32409d0cc6461f5892de680d5222f040110f17c755540284c35a5dbf34d604a62d5255a5d63fa7e9c03035fad1680eafa867
7
+ data.tar.gz: c182166a23faf3ae36202af92048b1a258847ea1de9541deabbee367101af68cfb67bb1d818c634ae8a92da7e8a24c4f94102185f8a7c75c3b43c2da9057f456
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.16.0] - 2022-09-30
5
+ ### Changed
6
+ - `SmartCore::Engine::ReadWriteLock` does not lock the current thread if the current thread has already acquired the lock;
7
+
4
8
  ## [0.15.0] - 2022-09-30
5
9
  ### Added
6
10
  - `SmartCore::Engine::ReadWriteLock#write_owned?` - checking that write lock is owned by current thread or not;
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smart_engine (0.15.0)
4
+ smart_engine (0.16.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -42,14 +42,19 @@ class SmartCore::Engine::ReadWriteLock
42
42
  #
43
43
  # @api public
44
44
  # @since 0.14.0
45
+ # @version 0.16.0
45
46
  def write_sync(&block)
46
- while @active_reader do; end
47
- @write_lock.synchronize do
48
- @active_reader = true
49
- begin
50
- yield
51
- ensure
52
- @active_reader = false
47
+ if @write_lock.owned?
48
+ yield
49
+ else
50
+ while @active_reader do; end
51
+ @write_lock.synchronize do
52
+ @active_reader = true
53
+ begin
54
+ yield
55
+ ensure
56
+ @active_reader = false
57
+ end
53
58
  end
54
59
  end
55
60
  end
@@ -6,7 +6,7 @@ module SmartCore
6
6
  #
7
7
  # @api public
8
8
  # @since 0.1.0
9
- # @version 0.15.0
10
- VERSION = '0.15.0'
9
+ # @version 0.16.0
10
+ VERSION = '0.16.0'
11
11
  end
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rustam Ibragimov