Put a mutex around Plant::sync() to stop 2 threads running it at the same time. ...