execute 0.1.65 → 0.1.66
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 +4 -4
- data/lib/execute.rb +14 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66b5a207b61a6135c7a2450956c36096e17163c4
|
4
|
+
data.tar.gz: 29686a56d20aa7aa76fc857fe24b665d4cce78d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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 == $$)
|