]> git.proxmox.com Git - libgit2.git/commit - src/unix/pthread.h
threads: introduce `git_thread_exit`
authorEdward Thomson <ethomson@github.com>
Fri, 18 Nov 2016 12:19:22 +0000 (07:19 -0500)
committerEdward Thomson <ethomson@github.com>
Fri, 18 Nov 2016 12:34:09 +0000 (07:34 -0500)
commit82f15896deb06d396d76d706f6c0146197d14b2c
tree8e0bc15feb02cb9a197ddc8db62d174515d94bf7
parenta6763ff93aed9a1486c4f84d77151ff57dd4795e
threads: introduce `git_thread_exit`

Introduce `git_thread_exit`, which will allow threads to terminate at an
arbitrary time, returning a `void *`.  On Windows, this means that we
need to store the current `git_thread` in TLS, so that we can set its
`return` value when terminating.

We cannot simply use `ExitThread`, since Win32 returns `DWORD`s from
threads; we return `void *`.
src/global.h
src/unix/pthread.h
src/win32/thread.c
src/win32/thread.h
tests/threads/basic.c