From 9ba604a9e474142c0fa1cd03830e2281cde5e66d Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Wed, 11 Apr 2012 12:49:46 +0700 Subject: [PATCH] compat/win32/pthread.h: Add an pthread_key_delete() implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ramsay Jones Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- compat/win32/pthread.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h index 2e20548557..8ad187344f 100644 --- a/compat/win32/pthread.h +++ b/compat/win32/pthread.h @@ -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;