synchronised paint history for thread safety