src/global.h


Log

Author Commit Date CI Message
Carlos Martín Nieto 081e76ba 2014-06-12T16:20:52 ssl: init everything all the time Bring together all of the OpenSSL initialization to git_threads_init() so it's together and doesn't need locks. Moving it here also gives us libssh2 thread safety (when built against openssl).
Carlos Martín Nieto cf15ac8a 2014-06-12T03:20:34 ssl: cargo-cult thread safety OpenSSL's tests init everything in the main thread, so let's do that.
Carlos Martín Nieto 1d3364ac 2014-06-11T20:52:15 netops: init OpenSSL once under lock The OpenSSL init functions are not reentrant, which means that running multiple fetches in parallel can cause us to crash. Use a mutex to init OpenSSL, and since we're adding this extra checks, init it only once.
Russell Belfer a3aa5f4d 2013-09-11T12:45:20 Add simple global shutdown hooks Increasingly there are a number of components that want to do some cleanup at global shutdown time (at least if there are not going to be memory leaks). This creates a very simple system of shutdown hooks that will be invoked by git_threads_shutdown. Right now, the maximum number of hooks is hardcoded, but since adding a hook is not a public API, it should be fine and I thought it was better to start off with really simple code.
Russell Belfer e976b56d 2013-04-15T14:27:53 Add git__compare_and_swap and use it This removes the lock from the repository object and changes the internals to use the new atomic git__compare_and_swap to update the _odb, _config, _index, and _refdb variables in a threadsafe manner.
Edward Thomson 359fc2d2 2013-01-08T17:07:25 update copyrights
Edward Thomson a8527429 2012-11-13T14:48:10 unload dll / destroy hash ctxs at shutdown
Edward Thomson d6fb0924 2012-11-05T12:37:15 Win32 CryptoAPI and CNG support for SHA1
Edward Thomson 7ebefd22 2012-11-13T10:10:40 move hash library func ptrs to global global
Carlos Martín Nieto 8cef828d 2012-08-18T22:11:49 Make the memory-window conrol structures global Up to now, the idea was that the user would do all the operations for one repository in the same thread. Thus we could have the memory-mapped window information thread-local and avoid any locking. This is not practical in a few environments, such as Apple's GCD which allocates threads arbitrarily or the .NET CLR, where the OS-level thread can change at any moment. Make the control structure global and protect it with a mutex so we don't depend on the thread currently executing the code.
Michael Schubert 6fc0bdc5 2012-07-17T10:52:16 Remove old error handling code
Vicent Martí 1a481123 2012-02-17T00:13:34 error-handling: References Yes, this is error handling solely for `refs.c`, but some of the abstractions leak all ofer the code base.
schu 5e0de328 2012-02-13T17:10:24 Update Copyright header Signed-off-by: schu <schu-github@schulog.org>
Vicent Marti a15c550d 2011-11-16T14:09:44 threads: Fix the shared global state with TLS See `global.c` for a description of what we're doing. When libgit2 is built with GIT_THREADS support, the threading system must be explicitly initialized with `git_threads_init()`.