Make readentry thread-safe
Make readentry an inline function, it's called a lot