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 +4 -4
- data/atomic.gemspec +1 -1
- data/ext/org/jruby/ext/atomic/AtomicReferenceLibrary.java +18 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20f8398764e9107775042e0a15438b9ef25ec768
|
4
|
+
data.tar.gz: 9a24887a14a0dd7b6e34315d3bd562f18085cf68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8bb15fb836f6c3fa7706cd46bf3314b277f8fdcf8a4e549398ef03bf946ca3b3df9bdb5d2ef9775735ad8d65276d09f7a5a7063290eb1280d11174dc390a88e
|
7
|
+
data.tar.gz: ef93a47266cde2b9e965c4c3f3d14e0c9dfae6d9b59e3954037d639dfe89f228b3401841892aa7081a7e6e743516438b850a739ddfc9df3c5c7d012d790b0b16
|
data/atomic.gemspec
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = %q{atomic}
|
7
|
-
s.version = "1.1.
|
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.
|
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-
|
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:
|