Skip to content

Conversation

@He-Pin
Copy link
Contributor

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

It was a little refractory when reading the code

Copy link
Contributor

@octonato octonato left a comment

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
try {
runnable.run()
if (self.get != null)
if (get != null)
Copy link
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
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?

Copy link
Contributor Author

@He-Pin He-Pin Aug 15, 2023

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.

runnable.run()
val driftNanos = clock() - getAndAdd(delay.toNanos)
if (self.get != null)
if (self.get() != null)
Copy link
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