compat/win32/pthread.h: Add an pthread_key_delete() implementation
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ramsay Jones committed
Apr 11, 2012 at 12:49 UTC
9ba604a9e474142c0fa1cd03830e2281cde5e66d
1 file changed
+5
compat/win32/pthread.h
+5
@@ -86,6 +86,11 @@ static inline int pthread_key_create(pthread_key_t *keyp, void (*destructor)(voi
86
return (*keyp = TlsAlloc()) == TLS_OUT_OF_INDEXES ? EAGAIN : 0;
87
}
88
89
+static inline int pthread_key_delete(pthread_key_t key)
90
+{
91
+ return TlsFree(key) ? 0 : EINVAL;
92
+}
93
+
94
static inline int pthread_setspecific(pthread_key_t key, const void *value)
95
{
96
return TlsSetValue(key, (void *)value) ? 0 : EINVAL;