summaryrefslogtreecommitdiff
path: root/src/commit.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-07-11 11:00:41 -0700
committerRussell Belfer <rb@github.com>2013-07-11 11:00:41 -0700
commit814de0bcab99f82dc637ba7ae34df5a0e9e1138c (patch)
tree1bcf2fa287cce621fdd6d842413a18fdbfc4f05f /src/commit.c
parentd70ce9bd7a1acec34b283d3bc92da84fbbf79860 (diff)
downloadlibgit2-814de0bcab99f82dc637ba7ae34df5a0e9e1138c.tar.gz
Update git__swap thread helper
This makes git__swap use the __sync_lock_test_and_set primitive with GCC and the InterlockedExchangePointer primitive with MSVC. Previously is used compare_and_swap in a way that was probably unintuitive for most thinking (i.e. it could fail to swap in the value if another thread raced in). Now it will always succeed and the last thread to run in a race will win instead of the first thread. This also fixes up a little confusion between volatile void ** and void * volatile * that came up with the Win32 compiler.
Diffstat (limited to 'src/commit.c')
0 files changed, 0 insertions, 0 deletions