From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/c/thread%2Ftss_delete.html | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 devdocs/c/thread%2Ftss_delete.html (limited to 'devdocs/c/thread%2Ftss_delete.html') diff --git a/devdocs/c/thread%2Ftss_delete.html b/devdocs/c/thread%2Ftss_delete.html new file mode 100644 index 00000000..3540ac07 --- /dev/null +++ b/devdocs/c/thread%2Ftss_delete.html @@ -0,0 +1,21 @@ +

tss_delete

Defined in header <threads.h>
void tss_delete( tss_t tss_id );
+
(since C11)

Destroys the thread-specific storage identified by tss_id.

+

The destructor, if one was registered by tss_create, is not called (they are only called at thread exit, either by thrd_exit or by returning from the thread function), it is the responsibility of the programmer to ensure that every thread that is aware of tss_id performed all necessary cleanup, before the call to tss_delete is made.

+

If tss_delete is called while another thread is executing destructors for tss_id, it's unspecified whether this changes the number of invocations to the associated destructor.

+

If tss_delete is called while the calling thread is executing destructors, then the destructor associated with tss_id will not be executed again on this thread.

+

Parameters

+ +
tss_id - thread-specific storage key previously returned by tss_create and not yet deleted by tss_delete

Return value

(none)

+

Notes

The POSIX equivalent of this function is pthread_key_delete.

+

The reason tss_delete never calls destructors is that the destructors (called at thread exit) are normally intended to be executed by the same thread that originally set the value (via tss_set) that the destructor will be dealing with, and may even rely on the values of that or other thread-specific data as seen by that thread. The thread executing tss_delete has no access to other threads' TSS. Even if it were possible to call the destructor for each thread's own value associated with tss_id, tss_delete would have to synchronize with every thread if only to examine whether the value of this TSS in that thread is null (destructors are only called against non-null values).

+

Example

References

+

+ © cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
+ https://en.cppreference.com/w/c/thread/tss_delete +

+
-- cgit v1.2.3