GLab/ToMaTo — pull request #831 by dswd (2014-10-31 12:35:55+00:00)
Title: Fix state flipping

fixes #796 and probably many more unsolved bugs

Elements must be first locked to ensure that no other thread uses them and then reloaded to ensure that recent changes are not lost.