Skip to content

Commit 759c025

Browse files
committed
Cleanup names
1 parent 44b3863 commit 759c025

17 files changed

+175
-70
lines changed

ext/ConcurrentRubyExtService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public boolean basicLoad(final Ruby runtime) throws IOException {
99
new com.concurrent_ruby.ext.JavaAtomicBooleanLibrary().load(runtime, false);
1010
new com.concurrent_ruby.ext.JavaAtomicFixnumLibrary().load(runtime, false);
1111
new com.concurrent_ruby.ext.JavaSemaphoreLibrary().load(runtime, false);
12-
new com.concurrent_ruby.ext.JavaSynchronizedObjectLibrary().load(runtime, false);
12+
new com.concurrent_ruby.ext.SynchronizationLibrary().load(runtime, false);
1313
return true;
1414
}
1515
}

ext/com/concurrent_ruby/ext/JavaSynchronizedObjectLibrary.java renamed to ext/com/concurrent_ruby/ext/SynchronizationLibrary.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,33 @@
1717
import org.jruby.RubyNil;
1818
import org.jruby.runtime.ThreadContext;
1919

20-
public class JavaSynchronizedObjectLibrary implements Library {
20+
public class SynchronizationLibrary implements Library {
2121

2222
public void load(Ruby runtime, boolean wrap) throws IOException {
23-
RubyModule concurrentModule = runtime.
23+
RubyModule synchronizationModule = runtime.
2424
defineModule("Concurrent").
25-
defineModuleUnder("SynchronizedObjectImplementations");
26-
RubyClass parent = concurrentModule.
27-
getClass("Abstract");
28-
if (parent == null) throw runtime.newRuntimeError("Concurrent::SynchronizedObject::Abstract is missing");
25+
defineModuleUnder("Synchronization");
26+
RubyClass parentClass = synchronizationModule.getClass("AbstractObject");
2927

30-
RubyClass synchronizedObjectJavaClass = concurrentModule.
31-
defineClassUnder("Java", parent, JRUBYREFERENCE_ALLOCATOR);
28+
if (parentClass == null)
29+
throw runtime.newRuntimeError("Concurrent::Synchronization::AbstractObject is missing");
3230

33-
synchronizedObjectJavaClass.defineAnnotatedMethods(Java.class);
31+
RubyClass synchronizedObjectJavaClass =
32+
synchronizationModule.defineClassUnder("JavaObject", parentClass, JRUBYREFERENCE_ALLOCATOR);
33+
34+
synchronizedObjectJavaClass.defineAnnotatedMethods(JavaObject.class);
3435
}
3536

3637
private static final ObjectAllocator JRUBYREFERENCE_ALLOCATOR = new ObjectAllocator() {
3738
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
38-
return new Java(runtime, klazz);
39+
return new JavaObject(runtime, klazz);
3940
}
4041
};
4142

42-
@JRubyClass(name = "Java", parent = "Abstract")
43-
public static class Java extends RubyObject {
43+
@JRubyClass(name = "JavaObject", parent = "AbstractObject")
44+
public static class JavaObject extends RubyObject {
4445

45-
public Java(Ruby runtime, RubyClass metaClass) {
46+
public JavaObject(Ruby runtime, RubyClass metaClass) {
4647
super(runtime, metaClass);
4748
}
4849

lib/concurrent.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'concurrent/version'
22

3-
require 'concurrent/synchronized_object'
3+
require 'concurrent/synchronization'
44

55
require 'concurrent/configuration'
66

lib/concurrent/actor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'concurrent/executor/serialized_execution'
44
require 'concurrent/ivar'
55
require 'concurrent/logging'
6-
require 'concurrent/synchronized_object'
6+
require 'concurrent/synchronization'
77

88
module Concurrent
99
# TODO https://github.com/celluloid/celluloid/wiki/Supervision-Groups ?

lib/concurrent/actor/core.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Actor
99
# @note devel: core should not block on anything, e.g. it cannot wait on
1010
# children to terminate that would eat up all threads in task pool and
1111
# deadlock
12-
class Core < SynchronizedObject
12+
class Core < Synchronization::Object
1313
include TypeCheck
1414
include Concurrent::Logging
1515

lib/concurrent/atomic/count_down_latch.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require 'concurrent/synchronized_object'
1+
require 'concurrent/synchronization'
22

33
module Concurrent
44

@@ -11,7 +11,7 @@ module Concurrent
1111
# method. Each of the other threads calls `#count_down` when done with its work.
1212
# When the latch counter reaches zero the waiting thread is unblocked and continues
1313
# with its work. A `CountDownLatch` can be used only once. Its value cannot be reset.
14-
class PureCountDownLatch < SynchronizedObject
14+
class PureCountDownLatch < Synchronization::Object
1515

1616
# @!macro [attach] count_down_latch_method_initialize
1717
#

lib/concurrent/atomic/cyclic_barrier.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
require 'concurrent/synchronized_object'
1+
require 'concurrent/synchronization'
22

33
module Concurrent
44

5-
class CyclicBarrier < SynchronizedObject
5+
class CyclicBarrier < Synchronization::Object
66

77
Generation = Struct.new(:status)
88
private_constant :Generation

lib/concurrent/atomic/event.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require 'thread'
2-
require 'concurrent/synchronized_object'
2+
require 'concurrent/synchronization'
33

44
module Concurrent
55

@@ -13,7 +13,7 @@ module Concurrent
1313
# `#reset` at any time once it has been set.
1414
#
1515
# @see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682655.aspx
16-
class Event < SynchronizedObject
16+
class Event < Synchronization::Object
1717

1818
# Creates a new `Event` in the unset state. Threads calling `#wait` on the
1919
# `Event` will block.

lib/concurrent/executor/serialized_execution.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
require 'delegate'
22
require 'concurrent/executor/executor'
33
require 'concurrent/logging'
4-
require 'concurrent/synchronized_object'
4+
require 'concurrent/synchronization'
55

66
module Concurrent
77

88
# Ensures passed jobs in a serialized order never running at the same time.
9-
class SerializedExecution < SynchronizedObject
9+
class SerializedExecution < Synchronization::Object
1010
include Logging
1111

1212
Job = Struct.new(:executor, :args, :block) do
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
require 'concurrent/synchronized_object_implementations/abstract'
1+
require 'concurrent/synchronization/abstract_object'

0 commit comments

Comments
 (0)