Put mutexes around the reference counts for the shared_object class. Maybe this...