From: Ramsay Jones Date: Wed, 11 Apr 2012 05:49:46 +0000 (+0700) Subject: compat/win32/pthread.h: Add an pthread_key_delete() implementation X-Git-Tag: v1.7.11-rc0~31^2~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9ba604a9e474142c0fa1cd03830e2281cde5e66d;p=git.git compat/win32/pthread.h: Add an pthread_key_delete() implementation Signed-off-by: Ramsay Jones Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h index 2e2054855..8ad187344 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;