Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.x: Small cleanups in the Scheduler class #5985

Merged
merged 1 commit into from
Apr 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/main/java/io/reactivex/Scheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,15 @@ public Runnable getWrappedRunnable() {
}
}

static class PeriodicDirectTask
static final class PeriodicDirectTask
implements Disposable, Runnable, SchedulerRunnableIntrospection {

@NonNull
final Runnable run;

@NonNull
final Worker worker;
@NonNull

volatile boolean disposed;

PeriodicDirectTask(@NonNull Runnable run, @NonNull Worker worker) {
Expand Down Expand Up @@ -554,12 +557,17 @@ public Runnable getWrappedRunnable() {
}

static final class DisposeTask implements Disposable, Runnable, SchedulerRunnableIntrospection {

@NonNull
final Runnable decoratedRun;

@NonNull
final Worker w;

@Nullable
Thread runner;

DisposeTask(Runnable decoratedRun, Worker w) {
DisposeTask(@NonNull Runnable decoratedRun, @NonNull Worker w) {
this.decoratedRun = decoratedRun;
this.w = w;
}
Expand Down