Skip to content

Commit

Permalink
compat/win32/pthread.h: Add an pthread_key_delete() implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Ramsay Jones <[email protected]>
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
Ramsay Jones authored and gitster committed Apr 11, 2012
1 parent 25a7850 commit 9ba604a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compat/win32/pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9ba604a

Please sign in to comment.