@@ -44,7 +44,6 @@ class FrameBuffer {
4444
4545 // Synchronization locks
4646 private final Lock lockWrite = new ReentrantLock ();
47- private final Lock lockRead = lockWrite ;
4847 final Lock lockSize = new ReentrantLock ();
4948 final Condition conditionSize = lockSize .newCondition ();
5049
@@ -120,36 +119,30 @@ void enqueueFrame() {
120119 lockSize .lock ();
121120 try {
122121 ++stepGame ;
123- //System.out.println("FrameBuffer: Enqueued buffer " + indexGame() + " on game step #" + stepGame);
124- if (framesBuffered () > 0 ) {
125- //System.out.println("FrameBuffer: There are now " + framesBuffered() + " frames buffered.");
126- }
127122 conditionSize .signalAll ();
128123 } finally { lockSize .unlock (); }
129124 } finally { lockWrite .unlock (); }
130125 }
131126
132127 /**
133- * Peeks the frontmost value in the buffer.
128+ * Peeks the front-most value in the buffer.
134129 */
135130 ByteBuffer peek () {
136131 lockSize .lock ();
137132 try {
138133 while (empty ()) conditionSize .awaitUninterruptibly ();
139- //System.out.println("FrameBuffer: Sharing buffer " + indexBot() + " on bot step #" + stepBot);
140134 return dataBuffer .get (indexBot ());
141135 } finally { lockSize .unlock (); }
142136
143137 }
144138
145139 /**
146- * Removes the frontmost frame in the buffer.
140+ * Removes the front-most frame in the buffer.
147141 */
148142 void dequeue () {
149143 lockSize .lock ();
150144 try {
151145 while (empty ()) conditionSize .awaitUninterruptibly ();
152- //System.out.println("FrameBuffer: Dequeuing buffer " + indexBot() + " on bot step #" + stepBot);
153146 ++stepBot ;
154147 conditionSize .signalAll ();
155148 } finally { lockSize .unlock (); }
0 commit comments