docs: private ThreadContextDescriptor captureThreadContext(Map<String, String> execProps, Object task, Set<String> internalNames,
                                                           Map<String, ?>... additionalThreadContextConfig) {
          execProps = execProps == null ? new TreeMap<String, String>() : new TreeMap<String, String>(execProps);
          if (internalNames == null || !execProps.containsKey(TASK_OWNER)) {
              execProps.put(TASK_OWNER, name);
              if (internalNames != null)
                  internalNames.add(TASK_OWNER);
          }
          if (task != null && (internalNames == null || !execProps.containsKey(ManagedTask.IDENTITY_NAME))) {
              execProps.put(ManagedTask.IDENTITY_NAME, task.getClass().getName());
              if (internalNames != null)
                  internalNames.add(ManagedTask.IDENTITY_NAME);
          }
  
          lock.readLock().lock();
          try {
              if (threadContextConfigurations == null) {
                  // Switch to write lock for lazy initialization
                  lock.readLock().unlock();
                  lock.writeLock().lock();
                  try {
                      if (threadContextConfigurations == null)
                          init();
                  } finally {
                      // Downgrade to read lock for rest of method
                      lock.readLock().lock();
                      lock.writeLock().unlock();
                  }
              }
  
              Map<String, Map<String, ?>> threadContextConfig = threadContextConfigurations;
              if (additionalThreadContextConfig != null && additionalThreadContextConfig.length > 0) {
                  threadContextConfig = new HashMap<String, Map<String, ?>>();
                  threadContextConfig.putAll(threadContextConfigurations);
                  for (Map<String, ?> config : additionalThreadContextConfig) {
                      String providerName = (String) config.get(THREAD_CONTEXT_PROVIDER);
                      if (providerName == null)
                          throw new IllegalArgumentException("additionalThreadContextConfig: " + config.toString());
                      threadContextConfig.put(providerName, config);
                  }
              }
              return threadContextMgr.captureThreadContext(threadContextConfig, execProps);
          } finally {
              lock.readLock().unlock();
          }
      }