title: Warning: TSD slot 10 retrieved but the thread data has already been torn down
body: <p>I did not find anything about this error... any idea where this comes from?</p>
  
  <pre><code>Warning: TSD slot 10 retrieved but the thread data has already been torn down.
  Warning: TSD slot 10 set but the thread data has already been torn down.
  </code></pre>
  
  <p>Not sure how to debug this error. Don't exactly know where the warning occurs. </p>
  
  <p>I found this in CFPlatform.c</p>
  
  <pre><code>// For the use of CF and Foundation only
  CF_EXPORT void *_CFGetTSD(uint32_t slot) {
      if (slot &gt; CF_TSD_MAX_SLOTS) {
          _CFLogSimple(kCFLogLevelError, "Error: TSD slot %d out of range (get)", slot);
          HALT;
      }
      __CFTSDTable *table = __CFTSDGetTable();
      if (!table) {
          // Someone is getting TSD during thread destruction. The table is gone, so we can't get any data anymore.
          _CFLogSimple(kCFLogLevelWarning, "Warning: TSD slot %d retrieved but the thread data has already been torn down.", slot);
          return NULL;
      }
      uintptr_t *slots = (uintptr_t *)(table-&gt;data);
      return (void *)slots[slot];
  }
  </code></pre>