robot-head/PixelPusher-java — pull request #7 by gregington (2013-11-23 13:39:28+00:00)
Title: Made locking on strips consistent.

Locking on strips was inconsistent.

Removed the Semaphore for striplock and replaced with an object to
synchronize on. Locking is now performed on all access, mutation and
iteration of strips by holding the stripLock.

Added lazy creation of strips in setAntiLog method. There was a race
condition that could intermittently cause a NullPointerException.

Removed copying of the strips array in copyHeader. It looks like the
PixelManager reference in the copied Strips will be incorrect, so it is
safer to re-create the pixels on demand.

This seems to work for may application. I was having issues with the PixelPusher not updating without this patch and also fixes intermittent ConcurrentModificationExceptions and the NullPointerException in setAntiLog.