summaryrefslogtreecommitdiff
path: root/tests/threads
Commit message (Collapse)AuthorAgeFilesLines
* tests: handle life without threadsethomson/clar_threadsEdward Thomson2016-11-181-1/+7
|
* threads::refdb tests: use new threaded clar assertEdward Thomson2016-11-181-10/+14
|
* threads: introduce `git_thread_exit`Edward Thomson2016-11-181-0/+27
| | | | | | | | | | 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 *`.
* refdb: use a constant for the number of per-thread creations/deletescmn/refdb-paraCarlos Martín Nieto2016-11-141-6/+8
|
* refdb: bubble up locked files on the read sideCarlos Martín Nieto2016-11-141-4/+13
| | | | | | On Windows we can find locked files even when reading a reference or the packed-refs file. Bubble up the error in this case as well to allow callers on Windows to retry more intelligently.
* refdb: expect threaded test deletes to raceCarlos Martín Nieto2016-11-141-0/+4
| | | | | At times we may try to delete a reference which a different thread has already taken care of.
* refdb: add retry logic to the threaded testsCarlos Martín Nieto2016-11-141-5/+13
| | | | | The logic simply consists of retrying for as long as the library says the data is locked, but it eventually gets through.
* refdb: adjust the threading tests to what we promiseCarlos Martín Nieto2016-11-141-78/+44
| | | | | | | | We say it's going to work if you use a different repository in each thread. Let's do precisely that in our code instead of hoping re-using the refdb is going to work. This test does fail currently, surfacing existing bugs.
* threads: split up OS-dependent thread codePatrick Steinhardt2016-06-202-4/+4
|
* iterator: use an options struct instead of argsEdward Thomson2015-08-281-1/+4
|
* Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-031-3/+3
| | | | | | | | | | The signature for the reflog is not something which changes dynamically. Almost all uses will be NULL, since we want for the repository's default identity to be used, making it noise. In order to allow for changing the identity, we instead provide git_repository_set_ident() and git_repository_ident() which allow a user to override the choice of signature.
* Rename git_threads_ to git_libgit2_Carlos Martín Nieto2014-11-081-2/+2
| | | | | | This describes their purpose better, as we now initialize ssl and some other global stuff in there. Calling the init function is not something which has been optional for a while now.
* iterator: submodules are determined by an index or treecmn/submodule-and-dirCarlos Martín Nieto2014-11-071-1/+1
| | | | | | | | | | | | We cannot know from looking at .gitmodules whether a directory is a submodule or not. We need the index or tree we are comparing against to tell us. Otherwise we have to assume the entry in .gitmodules is stale or otherwise invalid. Thus we pass the index of the repository into the workdir iterator, even if we do not want to compare against it. This follows what git does, which even for `git diff <tree>`, it will consider staged submodules as such.
* global: free the error message when exiting a threadcmn/free-tls-errorCarlos Martín Nieto2014-09-141-0/+14
| | | | | When we free the global state at thread termination, we must also free the error message in order not to leak the string once per thread.
* Use p_snprintf also in testsJacques Germishuys2014-08-051-4/+4
|
* Move yield to the tests and enable for FreeBSDcmn/sched-yieldCarlos Martín Nieto2014-07-031-0/+14
| | | | | | | Move the definition of git_thread_yield() to the test which needs it and add the correct definition for it for FreeBSD and derivatives. Original patch adding FreeBSD and derivatives by @jacquesg.
* Win32: Fix object::cache::threadmania test on x64Philip Kelley2014-06-072-3/+3
|
* Disable threads::refdb::edit_while_iterate testrb/dont-stop-diff-on-safecrlfRussell Belfer2014-05-081-7/+12
| | | | | | | | | | | It seems that with the various recent changes to reference updating and reflog writing, that the thread safety of refdb updates has been reduced (either that or it was never thread safe and the window for error has increased). Either way, this test is now sometimes segfaulting which is no good, so let's disable the test for now. We don't really make any public promises about thread safety for this type of operation, so I think this is acceptable, at least in the short term.
* Some memory leak fixesRussell Belfer2014-04-173-4/+10
|
* Fix race checking for existing index itemsRussell Belfer2014-04-171-2/+8
| | | | | | | In the threading tests, I was still seeing a race condition where the same item could end up being inserted multiple times into the index. Preserving the sorted-ness of the index outside of the `index_insert` call fixes the issue.
* Attribute file cache refactorRussell Belfer2014-04-174-44/+106
| | | | | | | This is a big refactoring of the attribute file cache to be a bit simpler which in turn makes it easier to enforce a lock around any updates to the cache so that it can be used in a threaded env. Tons of changes to the attributes and ignores code.
* Fix threading tests when threads disabledRussell Belfer2014-04-171-1/+2
|
* Index locking and entry allocation changesRussell Belfer2014-04-171-31/+90
| | | | | | | | | | | | | | | | | This makes the lock management on the index a little bit broader, having a number of routines hold the lock across looking up the item to be modified and actually making the modification. Still not true thread safety, but more pure index modifications are now safe which allows the simple cases (such as starting up a diff while index modifications are underway) safe enough to get the snapshot without hitting allocation problems. As part of this, I simplified the allocation of index entries to use a flex array and just put the path at the end of the index entry. This makes every entry self-contained and makes it a little easier to feel sure that pointers to strings aren't being accidentally copied and freed while other references are still being held.
* Add diff threading tests and attr file cache locksRussell Belfer2014-04-171-0/+152
| | | | | | This adds a basic test of doing simultaneous diffs on multiple threads and adds basic locking for the attr file cache because that was the immediate problem that arose from these tests.
* refs: remove the _with_log differentiationCarlos Martín Nieto2014-01-151-3/+3
| | | | | | Any well-behaved program should write a descriptive message to the reflog whenever it updates a reference. Let's make this more prominent by removing the version without the reflog parameters.
* Rename tests-clar to testsBen Straub2013-11-142-0/+249