Empty Synchronized method in game loop

Posted by Shijima on Game Development See other posts from Game Development or by Shijima
Published on 2014-05-29T19:55:04Z Indexed on 2014/05/30 3:54 UTC
Read the original article Hit count: 181

Filed under:

I am studying the gameloop used in Replica Island to understand a bit about Android game development. The main loop has the below logic...

GameThread.java (note the variable names in sample code dont match exact source code)

 while (!finished) {

        if (objectManager != null) {

            renderer.waitDrawingComplete();
            //Do more gameloop stuff after drawing is complete...
      }
 }

I was curious to see what waitDrawingComplete actually does, but found its just an empty syncrhonized method! I guess it does nothing, am I missing something here?

GameRenderer.java line 328

 public synchronized void waitDrawingComplete() {
 }

Source code can be checked out here with SVN if you feel like having a look: https://code.google.com/p/replicaisland/source/checkout

© Game Development or respective owner