diff --git a/README.md b/README.md index 21cd08d213..0d07b5b79e 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,11 @@ ## Getting Started -- Wired: **3.6.1** +- Wired: **3.6.2** - Tired: **2.5.5** (end of life) ```scala -libraryDependencies += "org.typelevel" %% "cats-effect" % "3.6.1" +libraryDependencies += "org.typelevel" %% "cats-effect" % "3.6.2" ``` The above represents the core, stable dependency which brings in the entirety of Cats Effect. This is *most likely* what you want. All current Cats Effect releases are published for Scala 2.12, 2.13, 3.2, and Scala.js 1.13. @@ -30,22 +30,22 @@ Depending on your use-case, you may want to consider one of the several other mo ```scala libraryDependencies ++= Seq( - "org.typelevel" %% "cats-effect-kernel" % "3.6.1", - "org.typelevel" %% "cats-effect-laws" % "3.6.1" % Test) + "org.typelevel" %% "cats-effect-kernel" % "3.6.2", + "org.typelevel" %% "cats-effect-laws" % "3.6.2" % Test) ``` If you're a middleware framework (like [Fs2](https://fs2.io/)), you probably want to depend on **std**, which gives you access to `Queue`, `Semaphore`, and much more without introducing a hard-dependency on `IO` outside of your tests: ```scala libraryDependencies ++= Seq( - "org.typelevel" %% "cats-effect-std" % "3.6.1", - "org.typelevel" %% "cats-effect" % "3.6.1" % Test) + "org.typelevel" %% "cats-effect-std" % "3.6.2", + "org.typelevel" %% "cats-effect" % "3.6.2" % Test) ``` You may also find some utility in the **testkit** and **kernel-testkit** projects, which contain `TestContext`, generators for `IO`, and a few other things: ```scala -libraryDependencies += "org.typelevel" %% "cats-effect-testkit" % "3.6.1" % Test +libraryDependencies += "org.typelevel" %% "cats-effect-testkit" % "3.6.2" % Test ``` Cats Effect provides backward binary compatibility within the 2.x and 3.x version lines, and both forward and backward compatibility within any major/minor line. This is analogous to the versioning scheme used by Cats itself, as well as other major projects such as Scala.js. Thus, any project depending upon Cats Effect 2.2.1 can be used with libraries compiled against Cats Effect 2.0.0 or 2.2.3, but *not* with libraries compiled against 2.3.0 or higher. diff --git a/core/jvm/src/main/scala/cats/effect/unsafe/WorkerThread.scala b/core/jvm/src/main/scala/cats/effect/unsafe/WorkerThread.scala index 4c021f1161..d7b7c9af93 100644 --- a/core/jvm/src/main/scala/cats/effect/unsafe/WorkerThread.scala +++ b/core/jvm/src/main/scala/cats/effect/unsafe/WorkerThread.scala @@ -636,6 +636,7 @@ private[effect] final class WorkerThread[P <: AnyRef]( acc } + @tailrec def notifyDoneSleeping(): Unit = { val st = parked.get() @@ -645,9 +646,15 @@ private[effect] final class WorkerThread[P <: AnyRef]( // this happens when we wake ourselves at the same moment the pool decides to wake us while (parked.get() eq ParkedSignal.Interrupting) {} - } else if (parked.compareAndSet(st, ParkedSignal.Unparked)) { - // we won the race to awaken ourselves, so we need to let the pool know - pool.doneSleeping() + } else { + if (parked.compareAndSet(st, ParkedSignal.Unparked)) { + // we won the race to awaken ourselves, so we need to let the pool know + pool.doneSleeping() + } else { + // lost CAS race, possibly concurrent `Interrupting`, + // we'll need to re-read `parked`: + notifyDoneSleeping() + } } } } diff --git a/docs/core/native-image.md b/docs/core/native-image.md index fe3264da8c..e8ba11d288 100644 --- a/docs/core/native-image.md +++ b/docs/core/native-image.md @@ -33,7 +33,7 @@ ThisBuild / scalaVersion := "2.13.8" lazy val root = (project in file(".")).enablePlugins(NativeImagePlugin).settings( name := "cats-effect-3-hello-world", - libraryDependencies += "org.typelevel" %% "cats-effect" % "3.6.1", + libraryDependencies += "org.typelevel" %% "cats-effect" % "3.6.2", Compile / mainClass := Some("com.example.Main"), nativeImageOptions += "--no-fallback", nativeImageVersion := "22.1.0" // It should be at least version 21.0.0 diff --git a/docs/core/scala-native.md b/docs/core/scala-native.md index 327e754683..9ab8f1ea9e 100644 --- a/docs/core/scala-native.md +++ b/docs/core/scala-native.md @@ -22,7 +22,7 @@ lazy val root = project.in(file(".")) .enablePlugins(ScalaNativePlugin) .settings( name := "cats-effect-3-hello-world", - libraryDependencies += "org.typelevel" %%% "cats-effect" % "3.6.1", + libraryDependencies += "org.typelevel" %%% "cats-effect" % "3.6.2", Compile / mainClass := Some("com.example.Main") ) diff --git a/docs/core/test-runtime.md b/docs/core/test-runtime.md index 2072f480e0..f990d80e5e 100644 --- a/docs/core/test-runtime.md +++ b/docs/core/test-runtime.md @@ -28,7 +28,7 @@ For those migrating code from Cats Effect 2, `TestControl` is a considerably mor In order to use `TestControl`, you will need to bring in the **cats-effect-testkit** dependency: ```scala -libraryDependencies += "org.typelevel" %% "cats-effect-testkit" % "3.6.1" % Test +libraryDependencies += "org.typelevel" %% "cats-effect-testkit" % "3.6.2" % Test ``` ## Example diff --git a/docs/faq.md b/docs/faq.md index d8bb121847..6b76fca1e8 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -9,7 +9,7 @@ title: FAQ ```scala-cli //> using scala "2.13.8" -//> using lib "org.typelevel::cats-effect::3.6.1" +//> using lib "org.typelevel::cats-effect::3.6.2" import cats.effect._ diff --git a/docs/getting-started.md b/docs/getting-started.md index 36bc14f59e..30a1fb6d03 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -6,7 +6,7 @@ title: Getting Started Add the following to your **build.sbt**: ```scala -libraryDependencies += "org.typelevel" %% "cats-effect" % "3.6.1" +libraryDependencies += "org.typelevel" %% "cats-effect" % "3.6.2" ``` Naturally, if you're using ScalaJS, you should replace the double `%%` with a triple `%%%`. If you're on Scala 2, it is *highly* recommended that you enable the [better-monadic-for](https://github.com/oleg-py/better-monadic-for) plugin, which fixes a number of surprising elements of the `for`-comprehension syntax in the Scala language: @@ -68,7 +68,7 @@ We will learn more about constructs like `start` and `*>` in later pages, but fo Of course, the easiest way to play with Cats Effect is to try it out in a Scala REPL. We recommend using [Ammonite](https://ammonite.io/#Ammonite-REPL) for this kind of thing. To get started, run the following lines (if not using Ammonite, skip the first line and make sure that Cats Effect and its dependencies are correctly configured on the classpath): ```scala -import $ivy.`org.typelevel::cats-effect:3.6.1` +import $ivy.`org.typelevel::cats-effect:3.6.2` import cats.effect.unsafe.implicits._ import cats.effect.IO diff --git a/docs/migration-guide.md b/docs/migration-guide.md index 827ce60ebb..2c40864311 100644 --- a/docs/migration-guide.md +++ b/docs/migration-guide.md @@ -81,9 +81,9 @@ Cats Effect 3 splits the code dependency into multiple modules. If you were prev The current non-test modules are: ```scala -"org.typelevel" %% "cats-effect-kernel" % "3.6.1", -"org.typelevel" %% "cats-effect-std" % "3.6.1", -"org.typelevel" %% "cats-effect" % "3.6.1", +"org.typelevel" %% "cats-effect-kernel" % "3.6.2", +"org.typelevel" %% "cats-effect-std" % "3.6.2", +"org.typelevel" %% "cats-effect" % "3.6.2", ``` - `kernel` - type class definitions, simple concurrency primitives @@ -96,7 +96,7 @@ The current non-test modules are: libraryDependencies ++= Seq( //... - "org.typelevel" %% "cats-effect" % "2.4.0", -+ "org.typelevel" %% "cats-effect" % "3.6.1", ++ "org.typelevel" %% "cats-effect" % "3.6.2", //... ) ``` diff --git a/docs/std/mapref.md b/docs/std/mapref.md index 321a6985bc..accbc5472e 100644 --- a/docs/std/mapref.md +++ b/docs/std/mapref.md @@ -32,7 +32,7 @@ as long as their keys belong to different shards. This is probably one of the most common uses of this datatype. ```scala mdoc:reset:silent -//> using lib "org.typelevel::cats-effect::3.6.1" +//> using lib "org.typelevel::cats-effect::3.6.2" import cats.effect.IO import cats.effect.std.MapRef diff --git a/docs/std/ref.md b/docs/std/ref.md index 296646cdbd..5ae2276ca4 100644 --- a/docs/std/ref.md +++ b/docs/std/ref.md @@ -33,7 +33,7 @@ This is probably one of the most common uses of this concurrency primitive. In this example, the workers will concurrently run and update the value of the `Ref`. ```scala mdoc:reset:silent -//> using lib "org.typelevel::cats-effect::3.6.1" +//> using lib "org.typelevel::cats-effect::3.6.2" import cats.effect.{IO, IOApp, Sync} import cats.effect.kernel.Ref diff --git a/docs/tutorial.md b/docs/tutorial.md index 7eaa60baca..ce2d746822 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -42,11 +42,11 @@ running the code snippets in this tutorial, it is recommended to use the same ```scala name := "cats-effect-tutorial" -version := "3.6.1" +version := "3.6.2" scalaVersion := "2.13.13" -libraryDependencies += "org.typelevel" %% "cats-effect" % "3.6.1" withSources() withJavadoc() +libraryDependencies += "org.typelevel" %% "cats-effect" % "3.6.2" withSources() withJavadoc() scalacOptions ++= Seq( "-feature",