Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ 11 ]
java: [ 11, 17, 21, 25 ]
# WARN: build.sbt depends on this key path, as scalaVersion and
# crossScalaVersions is determined from it
scala: [ 2.13.18, 3.3.7 ]
Expand Down
12 changes: 7 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import MonixBuildUtils.*
import org.typelevel.scalacoptions.ScalacOptions
import sbt.Keys.version
import sbt.{ Def, Global, Tags }
import sbt.{Def, Global, Tags}

import scala.collection.immutable.SortedSet
import MonixBuildUtils._
import org.typelevel.scalacoptions.ScalacOptions

val benchmarkProjects = List(
"benchmarksPrev",
Expand All @@ -27,7 +27,7 @@ addCommandAlias("ci-release", ";+publishSigned ;sonatypeBundleRelease")
val cats_Version = "2.7.0"
val catsEffect_Version = "2.5.5"
val fs2_Version = "2.5.11"
val jcTools_Version = "3.3.0"
val jcTools_Version = "4.0.5"
val reactiveStreams_Version = "1.0.4"
val macrotaskExecutor_Version = "1.0.0"
val minitest_Version = "2.9.6"
Expand Down Expand Up @@ -191,7 +191,7 @@ lazy val sharedSettings = pgpSettings ++ Seq(
"-Ywarn-unused:params",
"-Wunused:params",
"-Xlint:infer-any",
"-Wnonunit-statement"
"-Wnonunit-statement",
),
// Disabled from tpolecat for test compilation:
// -Wunused:patvars triggers on for-comprehension loop vars in tests (pre-existing pattern)
Expand All @@ -205,6 +205,8 @@ lazy val sharedSettings = pgpSettings ++ Seq(
},
// Turning off fatal warnings for doc generation
Compile / doc / tpolecatExcludeOptions ++= ScalacOptions.defaultConsoleExclude,
// Silence "unused @nowarn" —Thread#getId on JDK11
Compile / scalacOptions ++= Seq("-Wconf:cat=unused-nowarn:s"),
// Silence everything in auto-generated files
scalacOptions ++= {
if (isDotty.value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
package monix.execution.internal

import monix.execution.schedulers.CanBlock

import scala.annotation.nowarn
import scala.concurrent.{Await, Awaitable}
import scala.concurrent.duration.Duration
import scala.util.Try
Expand Down Expand Up @@ -175,6 +177,7 @@ private[monix] object Platform {
* To be used for multi-threading optimizations. Note that
* in JavaScript this always returns the same value.
*/
@nowarn("msg=deprecated")
def currentThreadId(): Long = {
Thread.currentThread().getId
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import monix.execution.internal.atomic.UnsafeAccess
import monix.execution.internal.collection.LowLevelConcurrentQueue
import monix.execution.internal.jctools.queues.MessagePassingQueue
import sun.misc.Unsafe

import scala.annotation.nowarn
import scala.collection.mutable

private[internal] abstract class FromCircularQueue[A](queue: MessagePassingQueue[A])
Expand Down Expand Up @@ -50,6 +52,7 @@ private[internal] abstract class FromCircularQueue[A](queue: MessagePassingQueue
}
}

@nowarn("msg=deprecated")
private[internal] object FromCircularQueue {
/**
* Builds a [[FromCircularQueue]] instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import monix.execution.internal.atomic.UnsafeAccess
import monix.execution.internal.collection.LowLevelConcurrentQueue
import monix.execution.internal.jctools.queues.MessagePassingQueue
import sun.misc.Unsafe

import scala.annotation.nowarn
import scala.collection.mutable

private[internal] abstract class FromMessagePassingQueue[A](queue: MessagePassingQueue[A])
Expand All @@ -47,6 +49,7 @@ private[internal] abstract class FromMessagePassingQueue[A](queue: MessagePassin
}
}

@nowarn("msg=deprecated")
private[internal] object FromMessagePassingQueue {
/**
* Builds a [[FromMessagePassingQueue]] instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@ package monix.execution.internal.forkJoin

import java.util.concurrent.ForkJoinPool.{ForkJoinWorkerThreadFactory, ManagedBlocker}
import java.util.concurrent.{ForkJoinPool, ForkJoinWorkerThread, ThreadFactory}

import monix.execution.internal.forkJoin.DynamicWorkerThreadFactory.EmptyBlockContext

import scala.annotation.nowarn
import scala.concurrent.{BlockContext, CanAwait}

// Implement BlockContext on FJP threads
private[monix] final class DynamicWorkerThreadFactory(
prefix: String,
uncaught: Thread.UncaughtExceptionHandler,
daemonic: Boolean)
extends ThreadFactory with ForkJoinWorkerThreadFactory {
daemonic: Boolean
) extends ThreadFactory with ForkJoinWorkerThreadFactory {

require(prefix ne null, "DefaultWorkerThreadFactory.prefix must be non null")

@nowarn("msg=deprecated")
def wire[T <: Thread](thread: T): T = {
thread.setDaemon(daemonic)
thread.setUncaughtExceptionHandler(uncaught)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ package monix.execution.internal.forkJoin
import java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory
import java.util.concurrent.{ForkJoinPool, ForkJoinWorkerThread, ThreadFactory}

import scala.annotation.nowarn

private[monix] final class StandardWorkerThreadFactory(
prefix: String,
uncaught: Thread.UncaughtExceptionHandler,
daemonic: Boolean)
extends ThreadFactory with ForkJoinWorkerThreadFactory {
daemonic: Boolean
) extends ThreadFactory with ForkJoinWorkerThreadFactory {

@nowarn("msg=deprecated")
def wire[T <: Thread](thread: T): T = {
thread.setDaemon(daemonic)
thread.setUncaughtExceptionHandler(uncaught)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@

package monix.execution.schedulers

import java.util.concurrent.ThreadFactory
import monix.execution.UncaughtExceptionReporter

import java.util.concurrent.ThreadFactory
import scala.annotation.nowarn

private[schedulers] object ThreadFactoryBuilder {
/** Constructs a ThreadFactory using the provided name prefix and appending
* with a unique incrementing thread identifier.
Expand All @@ -28,8 +30,10 @@ private[schedulers] object ThreadFactoryBuilder {
* @param daemonic specifies whether the created threads should be daemonic
* (non-daemonic threads are blocking the JVM process on exit).
*/

def apply(name: String, reporter: UncaughtExceptionReporter, daemonic: Boolean): ThreadFactory = {
new ThreadFactory {
@nowarn("msg=deprecated")
def newThread(r: Runnable) = {
val thread = new Thread(r)
thread.setName(name + "-" + thread.getId)
Expand Down
Loading