mini_racer 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47f63bb1b68c88c49733953c595d02a78579df94
4
- data.tar.gz: cddc00157752f5226cac8a124e563772fd38ae69
3
+ metadata.gz: 26a28b25121d8a935ef202c191063315cc0aa6f2
4
+ data.tar.gz: be7d2dbfed7abdf88f798fcb8d4faaa5a77bc9b5
5
5
  SHA512:
6
- metadata.gz: a1803f3c2520c1a308973a5497e43028c826e674555691ab81b1cabc4740f5e7cb781a8b5cda116355ad3cdc2cbe3513e4cc02e4b42cf62b1ec76f7acc830865
7
- data.tar.gz: 2bc1ffc53c30aad2917b1eb8a125cdef823299357a8293697508547370dfba1dc24f7839404af6ed5bdc969bacbc6d59cf697402cea973514258aaba0d8384f1
6
+ metadata.gz: ba51d49df0b522f47df971fd6e28c54fb510ab98cf863a4138dc3be79a4400a5b1b5884d6a025518cbc6359573b51c929c99c8062dd1f4dc7a399d56f4da8742
7
+ data.tar.gz: 76156c3ee051d4556577d31fc590806825e9c055aedd65468be2e285b204ae24af4fb02b7d507bfa3e62aed2f3380ad05a44a72efafec3e92b24a13135f65ced
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 25-10-2016
2
+
3
+ - 0.1.6
4
+
5
+ - Fix: timeout behavior was incorrect, in some cases stop could be called on already stopped contexts
6
+
1
7
  10-10-2016
2
8
 
3
9
  - 0.1.5
@@ -216,23 +216,33 @@ module MiniRacer
216
216
  def timeout(&blk)
217
217
  return blk.call unless @timeout
218
218
 
219
- _,wp = IO.pipe
219
+ mutex = Mutex.new
220
+ done = false
221
+
222
+ rp,wp = IO.pipe
220
223
 
221
224
  Thread.new do
222
225
  begin
223
- result = IO.select([wp],[],[],(@timeout/1000.0))
226
+ result = IO.select([rp],[],[],(@timeout/1000.0))
224
227
  if !result
225
- stop
228
+ mutex.synchronize do
229
+ stop unless done
230
+ end
226
231
  end
227
- rescue
232
+ rescue => e
233
+ STDERR.puts e
228
234
  STDERR.puts "FAILED TO TERMINATE DUE TO TIMEOUT"
229
235
  end
230
236
  end
231
237
 
232
238
  rval = blk.call
233
- wp.write("done")
239
+ mutex.synchronize do
240
+ done = true
241
+ end
234
242
 
243
+ wp.write("done")
235
244
  rval
245
+
236
246
  end
237
247
 
238
248
  def check_init_options!(options)
@@ -1,3 +1,3 @@
1
1
  module MiniRacer
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_racer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-16 00:00:00.000000000 Z
11
+ date: 2016-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler