#pragma once #include #include /*! \file threadlocal.h \brief Provides storage-slots for thread-specific data. */ #ifdef __cplusplus extern "C" { #endif typedef struct kinc_thread_local { kinc_thread_local_impl_t impl; } kinc_thread_local_t; /// /// Initializes a thread-specific storage-slot. /// /// The storage-slot to initialize KINC_FUNC void kinc_thread_local_init(kinc_thread_local_t *local); /// /// Destroys a storage-slot. /// /// The storage-slot to destroy KINC_FUNC void kinc_thread_local_destroy(kinc_thread_local_t *local); /// /// Gets the data in the storage-slot. /// /// The slot to query KINC_FUNC void *kinc_thread_local_get(kinc_thread_local_t *local); /// /// Sets the data in the storage-slot. /// /// The slot to put the data into /// The data to put in the slot KINC_FUNC void kinc_thread_local_set(kinc_thread_local_t *local, void *data); #ifdef __cplusplus } #endif