// if we were woken up, there are probably surfaces in the list,
// no need to check if the list is empty
}
// make a copy to avoid synchronization during the loop
D3DWindowSurfaceData surfaces[] = new D3DWindowSurfaceData[] {};
synchronized (this) {
surfaces = d3dwSurfaces.toArray(surfaces);
}
for (D3DWindowSurfaceData sd : surfaces) {
// skip invalid surfaces (they could have become invalid