Skip to content

Commit

Permalink
review comments #2
Browse files Browse the repository at this point in the history
  • Loading branch information
emil-bar committed Jan 8, 2025
1 parent a5cc213 commit 1e25408
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,15 @@ public <T> Fork<T> forkUser(Callable<T> f) {
* ExternalRunner#runAsync(ThrowingConsumer) for running functions within the scope
*/
public ExternalRunner externalRunner() {
externalSchedulerLock.lock();
try {
if (externalSchedulerActor == null) {
externalSchedulerActor = ActorRef.create(this, r -> r.accept(Scope.this));
if (externalSchedulerActor == null) {
externalSchedulerLock.lock();
try {
if (externalSchedulerActor == null) {
externalSchedulerActor = ActorRef.create(this, r -> r.accept(Scope.this));
}
} finally {
externalSchedulerLock.unlock();
}
} finally {
externalSchedulerLock.unlock();
}
return new ExternalRunner(externalSchedulerActor);
}
Expand Down

0 comments on commit 1e25408

Please sign in to comment.