Thread (36 messages) 36 messages, 6 authors, 2021-02-11

Re: [dpdk-dev] [PATCH v8 2/2] eal: add generic thread-local-storage functions

From: Dmitry Kozlyuk <hidden>
Date: 2021-01-06 20:10:37

On Wed,  6 Jan 2021 21:45:43 +0200, Tal Shnaiderman wrote:
[...]
+/**
+ * Delete a TLS data key visible to all threads in the process
+ * rte_tls_key is the opaque pointer allocated by rte_thread_tls_key_create.
This line repeats @param key description.
+ *
+ * @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);
[...]
+
+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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help