equal
deleted
inserted
replaced
66 timed_access(_ => None, f).get |
66 timed_access(_ => None, f).get |
67 |
67 |
68 |
68 |
69 /* unconditional change */ |
69 /* unconditional change */ |
70 |
70 |
71 def change(f: A => A) = synchronized { state = f(state) } |
71 def change(f: A => A): Unit = synchronized { state = f(state); notifyAll() } |
|
72 |
72 def change_result[B](f: A => (B, A)): B = synchronized { |
73 def change_result[B](f: A => (B, A)): B = synchronized { |
73 val (result, new_state) = f(state) |
74 val (result, new_state) = f(state) |
74 state = new_state |
75 state = new_state |
|
76 notifyAll() |
75 result |
77 result |
76 } |
78 } |
77 } |
79 } |