Re: [dpdk-dev] [PATCH v8 2/2] eal: add generic thread-local-storage functions
From: Tal Shnaiderman <hidden>
Date: 2021-01-06 20:33:58
From: Tal Shnaiderman <hidden>
Date: 2021-01-06 20:33:58
Subject: Re: [PATCH v8 2/2] eal: add generic thread-local-storage functions External email: Use caution opening links or attachments On Wed, 6 Jan 2021 21:45:43 +0200, Tal Shnaiderman wrote: [...]quoted
+/** + * Delete a TLS data key visible to all threads in the process + * rte_tls_key is the opaque pointer allocated byrte_thread_tls_key_create. This line repeats @param key description.quoted
+ * + * @param key + * The rte_tls_key allocated by rte_thread_tls_key_create(). + * + * @return + * On success, zero. + * On failure, a negative number. + */ +__rte_experimental +int rte_thread_tls_key_delete(rte_tls_key key);[...]quoted
+ +struct eal_tls_key { + pthread_key_t thread_index; +}; + +int +rte_thread_tls_key_create(rte_tls_key *key, void (*destructor)(void +*)) { + int err; + + *key = malloc(sizeof(*key));Should be sizeof(**key), which would be sizeof(struct eal_tls_key), as needed. Same for Windows file. I had to double-check my comment on v7.
Thanks, missed this one as well, sending v9.