Adding threadlocals-related functionality