summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala')
-rw-r--r--src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala b/src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala
index 8dfc40b9c8..d3c0b85f69 100644
--- a/src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala
+++ b/src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala
@@ -8,7 +8,8 @@
-package scala.collection
+package scala
+package collection
package mutable
/** This class implements synchronized priority queues using a binary heap.
@@ -23,6 +24,7 @@ package mutable
* @define Coll `SynchronizedPriorityQueue`
* @define coll synchronized priority queue
*/
+@deprecated("Comprehensive synchronization via selective overriding of methods is inherently unreliable. Consider java.util.concurrent.ConcurrentSkipListSet as an alternative.", "2.11.0")
class SynchronizedPriorityQueue[A](implicit ord: Ordering[A]) extends PriorityQueue[A] {
/** Checks if the queue is empty.
@@ -64,7 +66,7 @@ class SynchronizedPriorityQueue[A](implicit ord: Ordering[A]) extends PriorityQu
*
* @return the element with the highest priority.
*/
- override def dequeue(): A = synchronized { super.dequeue }
+ override def dequeue(): A = synchronized { super.dequeue() }
/** Returns the element with the highest priority in the queue,
* or throws an error if there is no element contained in the queue.
@@ -73,18 +75,10 @@ class SynchronizedPriorityQueue[A](implicit ord: Ordering[A]) extends PriorityQu
*/
override def head: A = synchronized { super.head }
- /** Returns the element with the highest priority in the queue,
- * or throws an error if there is no element contained in the queue.
- *
- * @return the element with the highest priority.
- */
- @deprecated("Use `head` instead.", "2.9.0")
- override def max: A = synchronized { super.max }
-
/** Removes all elements from the queue. After this operation is completed,
* the queue will be empty.
*/
- override def clear(): Unit = synchronized { super.clear }
+ override def clear(): Unit = synchronized { super.clear() }
/** Returns an iterator which yield all the elements of the priority
* queue in descending priority order.