The Mach-O format does not permit gcc to implement the __thread TLS specification, so we must instead emulate it using a single int cell allocated from memory and stored inside of the thread specific data associated with the current pthread. What makes this tricky is git_errno must be a valid lvalue, so we really need to return a pointer to the caller and deference it as part of the git_errno macro. The GCC-specific __attribute__((constructor)) extension is used to ensure the pthread_key_t is allocated before any Git functions are executed in the library, as this is necessary to access our thread specific storage. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
commit.h | Loading commit data... | |
common.h | Loading commit data... | |
errors.h | Loading commit data... | |
fileops.h | Loading commit data... | |
odb.h | Loading commit data... | |
oid.h | Loading commit data... | |
revwalk.h | Loading commit data... | |
thread-utils.h | Loading commit data... | |
zlib.h | Loading commit data... |