pthread_key: set value planned for destruction to NULL.

* This fixes bug fix #10951.

Change-Id: I152cea3651b3307171ea4d6a0c49aceae2f0f797
Reviewed-on: https://review.haiku-os.org/c/1456
Reviewed-by: Rene Gollent <[email protected]>
This commit is contained in:
Jérôme Duval
2019-05-20 14:09:15 +00:00
committed by waddlesplash
parent 33f7f28798
commit 3802df804f
@@ -35,7 +35,7 @@ get_key_destructor(uint32 key, int32& sequence)
/*! Function to get the thread specific value of a key in a lockless /*! Function to get the thread specific value of a key in a lockless
way. way. The thread specific value is reset to NULL.
\a sequence must be the sequence of the key table that this value \a sequence must be the sequence of the key table that this value
has to fit to. has to fit to.
*/ */
@@ -54,6 +54,8 @@ get_key_value(pthread_thread* thread, uint32 key, int32 sequence)
value = keyData.value; value = keyData.value;
} while (specificSequence != sequence); } while (specificSequence != sequence);
keyData.value = NULL;
return value; return value;
} }