Skip to content

Commit 9ba604a

Browse files
Ramsay Jonesgitster
authored andcommitted
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>
1 parent 25a7850 commit 9ba604a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compat/win32/pthread.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ static inline int pthread_key_create(pthread_key_t *keyp, void (*destructor)(voi
8686
return (*keyp = TlsAlloc()) == TLS_OUT_OF_INDEXES ? EAGAIN : 0;
8787
}
8888

89+
static inline int pthread_key_delete(pthread_key_t key)
90+
{
91+
return TlsFree(key) ? 0 : EINVAL;
92+
}
93+
8994
static inline int pthread_setspecific(pthread_key_t key, const void *value)
9095
{
9196
return TlsSetValue(key, (void *)value) ? 0 : EINVAL;

0 commit comments

Comments
 (0)