Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge committed Apr 21, 2023
1 parent 33d8ff5 commit 1f95fd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ final class SelectorSystem private (provider: SelectorProvider) extends PollingS

if ((node.interest & readyOps) != 0) { // execute callback and drop this node
val cb = node.callback
if (cb != null) cb(value)
if (cb != null) {
cb(value)
polled = true
}
if (prev ne null) prev.next = next
polled = true
} else { // keep this node
prev = node
if (head eq null)
Expand All @@ -76,7 +78,7 @@ final class SelectorSystem private (provider: SelectorProvider) extends PollingS
key.attach(head)
}

!selector.keys().isEmpty()
polled
} else false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import java.time.temporal.ChronoField
import java.util.Comparator
import java.util.concurrent.{ConcurrentSkipListSet, ThreadLocalRandom}
import java.util.concurrent.atomic.{AtomicBoolean, AtomicInteger}
import java.util.concurrent.locks.LockSupport

/**
* Work-stealing thread pool which manages a pool of [[WorkerThread]] s for the specific purpose
Expand Down Expand Up @@ -339,7 +338,7 @@ private[effect] final class WorkStealingThreadPool(
state.getAndAdd(DeltaSearching)
workerThreadPublisher.get()
val worker = workerThreads(index)
LockSupport.unpark(worker)
system.interrupt(worker, pollers(index).asInstanceOf[system.Poller])
} // else: was already unparked
}

Expand Down

0 comments on commit 1f95fd7

Please sign in to comment.