proper signaling after each state update (NB: ML version does this uniformly via timed_access);
authorwenzelm
Thu, 24 Apr 2014 13:10:42 +0200
changeset 56694 c4e77643aad6
parent 56693 0423c957b081
child 56695 963732291084
proper signaling after each state update (NB: ML version does this uniformly via timed_access);
src/Pure/Concurrent/synchronized.scala
--- a/src/Pure/Concurrent/synchronized.scala	Thu Apr 24 12:10:26 2014 +0200
+++ b/src/Pure/Concurrent/synchronized.scala	Thu Apr 24 13:10:42 2014 +0200
@@ -68,10 +68,12 @@
 
   /* unconditional change */
 
-  def change(f: A => A) = synchronized { state = f(state) }
+  def change(f: A => A): Unit = synchronized { state = f(state); notifyAll() }
+
   def change_result[B](f: A => (B, A)): B = synchronized {
     val (result, new_state) = f(state)
     state = new_state
+    notifyAll()
     result
   }
 }