Input: tsdev - implement proper locking