* tsd_create - create thread specific data key * @keyp: lookup key address * @dtor: destructor called during tsd_destroy() or tsd_exit() * * Provided key must be set to 0 or it assumed to be already in use. * The dtor is allowed to be NULL in which case no additional cleanup * for the data is performed during tsd_destroy() or tsd_exit(). * * Caller must prevent racing tsd_set() or tsd_get(
| 565 | * safe from racing tsd_create(), tsd_destroy(), and tsd_exit(). |
| 566 | */ |
| 567 | void |
| 568 | tsd_create(uint_t *keyp, dtor_func_t dtor) |
| 569 | { |
| 570 | ASSERT3P(keyp, !=, NULL); |
| 571 | if (*keyp) |
| 572 | return; |
| 573 | |
| 574 | (void) tsd_hash_add_key(tsd_hash_table, keyp, dtor); |
| 575 | } |
| 576 | EXPORT_SYMBOL(tsd_create); |
| 577 | |
| 578 | /* |
no test coverage detected