atomic 1.1.12 → 1.1.13

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: d912d6413d97043b1c5f6c85738eff1e7beebca3
4
- data.tar.gz: d7946f9bd4b8e4d50b2f90107a3a170b5f4915a3
3
+ metadata.gz: 20f8398764e9107775042e0a15438b9ef25ec768
4
+ data.tar.gz: 9a24887a14a0dd7b6e34315d3bd562f18085cf68
5
5
  SHA512:
6
- metadata.gz: 0e6e880bad5ecb50051dcb5e3640afdfa2125036e9575bb82c12caab5aa66c89d731ee3b22d73b20059653eeb01fed5ecbbcc0dc7614525c05e05d13381217a9
7
- data.tar.gz: 6fcdb72380f469a27a5ce9a07ae26cca1471614279e8dc50ab6594ca082d77a4e3e2030079a689ca691610b63dc415ad3e04076da470a55e7dab5dfcb378691f
6
+ metadata.gz: b8bb15fb836f6c3fa7706cd46bf3314b277f8fdcf8a4e549398ef03bf946ca3b3df9bdb5d2ef9775735ad8d65276d09f7a5a7063290eb1280d11174dc390a88e
7
+ data.tar.gz: ef93a47266cde2b9e965c4c3f3d14e0c9dfae6d9b59e3954037d639dfe89f228b3401841892aa7081a7e6e743516438b850a739ddfc9df3c5c7d012d790b0b16
@@ -4,7 +4,7 @@
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = %q{atomic}
7
- s.version = "1.1.12"
7
+ s.version = "1.1.13"
8
8
  s.authors = ["Charles Oliver Nutter", "MenTaLguY", "Sokolov Yura"]
9
9
  s.date = Time.now.strftime('%Y-%m-%d')
10
10
  s.summary = "An atomic reference implementation for JRuby, Rubinius, and MRI"
@@ -12,6 +12,7 @@
12
12
 
13
13
  package org.jruby.ext.atomic;
14
14
 
15
+ import java.lang.reflect.Field;
15
16
  import java.io.IOException;
16
17
  import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
17
18
  import org.jruby.Ruby;
@@ -25,7 +26,6 @@ import org.jruby.runtime.ObjectAllocator;
25
26
  import org.jruby.runtime.ThreadContext;
26
27
  import org.jruby.runtime.builtin.IRubyObject;
27
28
  import org.jruby.runtime.load.Library;
28
- import org.jruby.util.unsafe.UnsafeHolder;
29
29
 
30
30
  /**
31
31
  * This library adds an atomic reference type to JRuby for use in the atomic
@@ -154,6 +154,23 @@ public class AtomicReferenceLibrary implements Library {
154
154
  }
155
155
  }
156
156
  }
157
+
158
+ private static final class UnsafeHolder {
159
+ private UnsafeHolder(){}
160
+
161
+ public static final sun.misc.Unsafe U = loadUnsafe();
162
+
163
+ private static sun.misc.Unsafe loadUnsafe() {
164
+ try {
165
+ Class unsafeClass = Class.forName("sun.misc.Unsafe");
166
+ Field f = unsafeClass.getDeclaredField("theUnsafe");
167
+ f.setAccessible(true);
168
+ return (sun.misc.Unsafe) f.get(null);
169
+ } catch (Exception e) {
170
+ return null;
171
+ }
172
+ }
173
+ }
157
174
 
158
175
  public static class JRubyReference8 extends JRubyReference {
159
176
  public JRubyReference8(Ruby runtime, RubyClass klass) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atomic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.12
4
+ version: 1.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Oliver Nutter
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-08-02 00:00:00.000000000 Z
13
+ date: 2013-08-14 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: An atomic reference implementation for JRuby, Rubinius, and MRI
16
16
  email: