@@ -126,6 +126,7 @@ def post_on(executor, *args, &job)
126126
127127 # Represents an event which will happen in future (will be completed). It has to always happen.
128128 class Event < Synchronization ::LockableObject
129+ safe_initialization!
129130 include Concern ::Deprecation
130131
131132 # @!visibility private
@@ -167,13 +168,15 @@ def to_sym
167168 COMPLETED = Completed . new
168169
169170 def initialize ( promise , default_executor )
171+ super ( )
170172 @Promise = promise
171173 @DefaultExecutor = default_executor
172174 @Touched = AtomicBoolean . new ( false )
173175 @Callbacks = LockFreeStack . new
174- @Waiters = LockFreeStack . new # TODO replace with AtomicFixnum, avoid aba problem
176+ # TODO (pitr 12-Sep-2015): replace with AtomicFixnum, avoid aba problem
177+ # TODO (pitr 12-Sep-2015): look at java.util.concurrent solution
178+ @Waiters = LockFreeStack . new
175179 @State = AtomicReference . new PENDING
176- super ( ) # ensures visibility
177180 end
178181
179182 # @return [:pending, :completed]
@@ -877,9 +880,11 @@ def hide_completable
877880 # @abstract
878881 # @!visibility private
879882 class AbstractPromise < Synchronization ::Object
883+ safe_initialization!
884+
880885 def initialize ( future )
881- @Future = future
882886 super ( )
887+ @Future = future
883888 end
884889
885890 def future
@@ -1373,10 +1378,12 @@ def initialize(default_executor, intended_time)
13731378
13741379 # @note proof of concept
13751380 class Channel < Synchronization ::Object
1381+ safe_initialization!
1382+
13761383 # TODO make lock free
13771384 def initialize
1378- @ProbeSet = Concurrent ::Channel ::WaitableList . new
13791385 super ( )
1386+ @ProbeSet = Concurrent ::Channel ::WaitableList . new
13801387 end
13811388
13821389 def probe_set_size
0 commit comments