Added more fine grained locks to the thread local buffer to improve parallel performance under high contention.