src: thread safety