Skip to content

=act Extract AtomicCancellable in Scheduler.#31915

Open
He-Pin wants to merge 1 commit into
akka:mainfrom
He-Pin:scheduler-op
Open

=act Extract AtomicCancellable in Scheduler.#31915
He-Pin wants to merge 1 commit into
akka:mainfrom
He-Pin:scheduler-op

Conversation

@He-Pin

@He-Pin He-Pin commented Apr 18, 2023

Copy link
Copy Markdown
Contributor

It was a little refractory when reading the code

@octonato octonato left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@He-Pin
He-Pin force-pushed the scheduler-op branch 2 times, most recently from 233dad1 to 0e66f16 Compare August 15, 2023 12:05
Comment thread akka-actor/src/main/scala/akka/actor/Scheduler.scala
Comment thread akka-actor/src/main/scala/akka/actor/Scheduler.scala Outdated
try {
runnable.run()
if (self.get != null)
if (get != null)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the other place it is

if (self.get() != null)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is self => used there but not here?

@He-Pin He-Pin Aug 15, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I need to access the AtomicReference there but not the outer AtomicLong, and here we can access it directly.

Comment thread akka-actor/src/main/scala/akka/actor/Scheduler.scala Outdated
runnable.run()
val driftNanos = clock() - getAndAdd(delay.toNanos)
if (self.get != null)
if (self.get() != null)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self refs to the AtomicReference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants