I'm developing a (scroll) game and i'm getting weird messages in LogCat:
- lock_layer() timed out but didn't appear to need to be locked and we recovered(..)
- lock_layer timed out (is the CPU pegged?)...
- executeScheduledBrodcasts() skipped, contention on the client. We'll try again later.
it looks like the rendering takes too long and causes the warning (i'm drawing ~ 50 images every frame), but is this the emulator fault? When i test it on a device (sony ericsson xperia x8), running 1.6, i don't see any lag or any performance drops (i get ~ 60fps). I get this warning only in android 1.6.
Should i ignore it? Could it cause the game to crash? Am i doing something horribly wrong or is it a bug?
Run code:
while(running) {
try {
c = holder.lockCanvas(null);
synchronized(holder) {
// getElements - returns a Vector of elements to be drawn relative to camera
elements = collection.getElements(cameraX,cameraY,cameraWidth,cameraHeight);
for(int i =0 ; i < elements.size(); i++) {
// draw the element according to camera
c.drawBitmap(image,elements.get(i).x,elements.get(i).y);
}
}
} finally {
holder.unloackCanvasAndPost(c);
}
}