Minor change. Also, this currently dead-locks. Looks like we really need a cross-thread rw lock.