execute 0.1.65 → 0.1.66

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/execute.rb +14 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c9c3a10cf310529427b81e4f7fd174bab6f275bf
4
- data.tar.gz: abf191c993c3e3162762cc5bbd60bff655119ab5
3
+ metadata.gz: 66b5a207b61a6135c7a2450956c36096e17163c4
4
+ data.tar.gz: 29686a56d20aa7aa76fc857fe24b665d4cce78d4
5
5
  SHA512:
6
- metadata.gz: a7a90bc3626c1b270ebc0c53e529317fc80f2f42a8d7482f944f502d4ff05437208eefed956467afdeea283fea0eadc1198e686b84416ef82cba7a55783ba4fb
7
- data.tar.gz: 43e211fd4a782099c3d8e93f21df795d5921bde6127ea85f27af3e1ad99881648d8cb6b26ad009716173e99c4f111ba40df61d0cd8b37c3bd7cf2c4478ffe1c4
6
+ metadata.gz: fb8f9de4b7b364034f9895692aa31adaf5ef55ca1a63ca45c93b70a84419af298b3549ccfe7b47525648abad1068c9abf265a15fef72165c9eadf7710a0a624b
7
+ data.tar.gz: cc3319e16988b19701e605d8ab649d921f80ee3e737106be947e1910a773b8a431750fce680e8cf090091be563821e537078a6b559b671ec9d1d02dc04807681
data/lib/execute.rb CHANGED
@@ -87,7 +87,7 @@ class Execute < Hash
87
87
  Thread.new do
88
88
  while wait_thr.alive? && !stop_threads do
89
89
  if((Time.now - start_time).to_f > timeout)
90
- mutex.synchronize { self[:timed_out] = true }
90
+ self[:timed_out] = true
91
91
  mutex.synchronize { stop_threads = true }
92
92
  interrupt
93
93
  Thread.stop
@@ -164,6 +164,19 @@ class Execute < Hash
164
164
  self[:exit_code]=1 unless(!self[:exit_code].nil? || (self[:exit_code] == 0))
165
165
  end
166
166
  end
167
+
168
+ def []=(key,value)
169
+ mutex = Mutex.new
170
+ mutex.synchronize { super(key, value) }
171
+ end
172
+
173
+ def [](key)
174
+ value = nil
175
+ mutex = Mutex.new
176
+ mutex.synchronize { value = super(key) }
177
+ return value
178
+ end
179
+
167
180
  def command_pid
168
181
  Sys::ProcTable.ps do |p|
169
182
  if(p.ppid == $$)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: execute
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.65
4
+ version: 0.1.66
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Marshall