compat/win32/pthread.h: Add an pthread_key_delete() implementation
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>
Wed, 11 Apr 2012 05:49:46 +0000 (12:49 +0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 Apr 2012 18:08:43 +0000 (11:08 -0700)
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>
compat/win32/pthread.h

index 2e205485570bf62a11112c665624203207c724a9..8ad187344fd93e894a2f1cbfaa0fb59fd832de5b 100644 (file)
@@ -86,6 +86,11 @@ static inline int pthread_key_create(pthread_key_t *keyp, void (*destructor)(voi
        return (*keyp = TlsAlloc()) == TLS_OUT_OF_INDEXES ? EAGAIN : 0;
 }
 
+static inline int pthread_key_delete(pthread_key_t key)
+{
+       return TlsFree(key) ? 0 : EINVAL;
+}
+
 static inline int pthread_setspecific(pthread_key_t key, const void *value)
 {
        return TlsSetValue(key, (void *)value) ? 0 : EINVAL;