use RW mutex for synchronisation