⛏️ index : haiku.git

author Jérôme Duval <jerome.duval@gmail.com> 2019-05-17 17:46:49.0 +02:00:00
committer Augustin Cavalier <waddlesplash@gmail.com> 2020-03-30 19:57:45.0 -04:00:00
commit
edfc996830c6e0da9c0e9875e28ccfb6e5fe0fdb [patch]
tree
e6372fbbcd98a9bd3a2c1abae3177646e60a3a1b
parent
d3eb732bc1f1e9ebd9d4438f88323863f36c9afc
download
edfc996830c6e0da9c0e9875e28ccfb6e5fe0fdb.tar.gz

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 <rene@gollent.com>

Diff

 src/system/libroot/posix/pthread/pthread_key.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/system/libroot/posix/pthread/pthread_key.cpp b/src/system/libroot/posix/pthread/pthread_key.cpp
index 431a4d4..be251f7 100644
--- a/src/system/libroot/posix/pthread/pthread_key.cpp
+++ b/src/system/libroot/posix/pthread/pthread_key.cpp
@@ -35,7 +35,7 @@


/*!	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
	has to fit to.
*/
@@ -53,6 +53,8 @@

		value = keyData.value;
	} while (specificSequence != sequence);

	keyData.value = NULL;

	return value;
}