Made tap_adapter write thread-safe