Some utilities to help make thread-safe programs (esp. in Rails)