<commit_before>package scala.reactive



import scala.collection._
import scala.reactive.util.Monitor



trait EventQueue[@spec(Int, Long, Double) T] {

  def enqueue(x: T): Int

  def dequeue(emitter: Events.Emitter[T]): Int

  def size: Int

}


object EventQueue {

  abstract class Factory extends Serializable {
    def newInstance[@spec(Int, Long, Double) T: Arrayable]: EventQueue[T]
  }

  class Zero[@spec(Int, Long, Double) T: Arrayable]
  extends EventQueue[T] {
    def enqueue(x: T) = 0
    def dequeue(emitter: Events.Emitter[T]) = 0
    def size = 0
  }

  def isZero(q: EventQueue[_]): Boolean = q.isInstanceOf[Zero[_]]

  class UnrolledRing[@spec(Int, Long, Double) T: Arrayable](
    private[reactive] val monitor: Monitor = new Monitor
  ) extends EventQueue[T] {
    private[reactive] val ring = new scala.reactive.core.UnrolledRing[T]

    def enqueue(x: T): Int = monitor.synchronized {
      ring.enqueue(x)
      ring.size
    }

    def dequeue(emitter: Events.Emitter[T]): Int = {
      var remaining = -1
      val x = monitor.synchronized {
        remaining = ring.size - 1
        ring.dequeue()
      }
      emitter react x
      remaining
    }
<commit_msg>Fix hopefully last reference to old package name.<commit_after>package scala.reactive



import scala.collection._
import scala.reactive.util.Monitor



trait EventQueue[@spec(Int, Long, Double) T] {

  def enqueue(x: T): Int

  def dequeue(emitter: Events.Emitter[T]): Int

  def size: Int

}


object EventQueue {

  abstract class Factory extends Serializable {
    def newInstance[@spec(Int, Long, Double) T: Arrayable]: EventQueue[T]
  }

  class Zero[@spec(Int, Long, Double) T: Arrayable]
  extends EventQueue[T] {
    def enqueue(x: T) = 0
    def dequeue(emitter: Events.Emitter[T]) = 0
    def size = 0
  }

  def isZero(q: EventQueue[_]): Boolean = q.isInstanceOf[Zero[_]]

  class UnrolledRing[@spec(Int, Long, Double) T: Arrayable](
    private[reactive] val monitor: Monitor = new Monitor
  ) extends EventQueue[T] {
    private[reactive] val ring = new scala.reactive.common.UnrolledRing[T]

    def enqueue(x: T): Int = monitor.synchronized {
      ring.enqueue(x)
      ring.size
    }

    def dequeue(emitter: Events.Emitter[T]): Int = {
      var remaining = -1
      val x = monitor.synchronized {
        remaining = ring.size - 1
        ring.dequeue()
      }
      emitter react x
      remaining
    }

{'fraction_non_alphanumeric': 0.11538461538461539, 'fraction_numerical': 0.0041356492969396195, 'mean_word_length': 3.1069609507640066, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2486280', 'n_tokens_mistral': 830, 'n_tokens_neox': 779, 'n_words': 215}