On which thread does this run? Is this safe?