Now that this is in a header file, having it in an anonymous namespace looks kind of dirty. Consider adding it to the leveldb namespace. Also, wouldn't it make sense to have this in threading.h?