@classmethod
def set_default(cls, key, value):
    """Set global default value for given key. Shared by all threads. These are used
        when no thread-local value is available for given key."""
    with cls.__default_context_lock:
        cls.__default_context[key] = value
