@@ -93,7 +93,7 @@ static void set_odb(git_repository *repo, git_odb *odb)
9393 GIT_REFCOUNT_INC (odb );
9494 }
9595
96- if ((odb = git__swap (repo -> _odb , odb )) != NULL ) {
96+ if ((odb = git_atomic_swap (repo -> _odb , odb )) != NULL ) {
9797 GIT_REFCOUNT_OWN (odb , NULL );
9898 git_odb_free (odb );
9999 }
@@ -106,7 +106,7 @@ static void set_refdb(git_repository *repo, git_refdb *refdb)
106106 GIT_REFCOUNT_INC (refdb );
107107 }
108108
109- if ((refdb = git__swap (repo -> _refdb , refdb )) != NULL ) {
109+ if ((refdb = git_atomic_swap (repo -> _refdb , refdb )) != NULL ) {
110110 GIT_REFCOUNT_OWN (refdb , NULL );
111111 git_refdb_free (refdb );
112112 }
@@ -119,7 +119,7 @@ static void set_config(git_repository *repo, git_config *config)
119119 GIT_REFCOUNT_INC (config );
120120 }
121121
122- if ((config = git__swap (repo -> _config , config )) != NULL ) {
122+ if ((config = git_atomic_swap (repo -> _config , config )) != NULL ) {
123123 GIT_REFCOUNT_OWN (config , NULL );
124124 git_config_free (config );
125125 }
@@ -134,7 +134,7 @@ static void set_index(git_repository *repo, git_index *index)
134134 GIT_REFCOUNT_INC (index );
135135 }
136136
137- if ((index = git__swap (repo -> _index , index )) != NULL ) {
137+ if ((index = git_atomic_swap (repo -> _index , index )) != NULL ) {
138138 GIT_REFCOUNT_OWN (index , NULL );
139139 git_index_free (index );
140140 }
@@ -1054,7 +1054,7 @@ int git_repository_config__weakptr(git_config **out, git_repository *repo)
10541054 if (!error ) {
10551055 GIT_REFCOUNT_OWN (config , repo );
10561056
1057- config = git__compare_and_swap (& repo -> _config , NULL , config );
1057+ config = git_atomic_compare_and_swap (& repo -> _config , NULL , config );
10581058 if (config != NULL ) {
10591059 GIT_REFCOUNT_OWN (config , NULL );
10601060 git_config_free (config );
@@ -1107,7 +1107,7 @@ int git_repository_odb__weakptr(git_odb **out, git_repository *repo)
11071107 GIT_ASSERT_ARG (repo );
11081108 GIT_ASSERT_ARG (out );
11091109
1110- * out = git__load (repo -> _odb );
1110+ * out = git_atomic_load (repo -> _odb );
11111111 if (* out == NULL ) {
11121112 git_buf odb_path = GIT_BUF_INIT ;
11131113 git_odb * odb ;
@@ -1125,14 +1125,14 @@ int git_repository_odb__weakptr(git_odb **out, git_repository *repo)
11251125 return error ;
11261126 }
11271127
1128- odb = git__compare_and_swap (& repo -> _odb , NULL , odb );
1128+ odb = git_atomic_compare_and_swap (& repo -> _odb , NULL , odb );
11291129 if (odb != NULL ) {
11301130 GIT_REFCOUNT_OWN (odb , NULL );
11311131 git_odb_free (odb );
11321132 }
11331133
11341134 git_buf_dispose (& odb_path );
1135- * out = git__load (repo -> _odb );
1135+ * out = git_atomic_load (repo -> _odb );
11361136 }
11371137
11381138 return error ;
@@ -1170,7 +1170,7 @@ int git_repository_refdb__weakptr(git_refdb **out, git_repository *repo)
11701170 if (!error ) {
11711171 GIT_REFCOUNT_OWN (refdb , repo );
11721172
1173- refdb = git__compare_and_swap (& repo -> _refdb , NULL , refdb );
1173+ refdb = git_atomic_compare_and_swap (& repo -> _refdb , NULL , refdb );
11741174 if (refdb != NULL ) {
11751175 GIT_REFCOUNT_OWN (refdb , NULL );
11761176 git_refdb_free (refdb );
@@ -1218,7 +1218,7 @@ int git_repository_index__weakptr(git_index **out, git_repository *repo)
12181218 if (!error ) {
12191219 GIT_REFCOUNT_OWN (index , repo );
12201220
1221- index = git__compare_and_swap (& repo -> _index , NULL , index );
1221+ index = git_atomic_compare_and_swap (& repo -> _index , NULL , index );
12221222 if (index != NULL ) {
12231223 GIT_REFCOUNT_OWN (index , NULL );
12241224 git_index_free (index );
@@ -3044,8 +3044,8 @@ int git_repository_set_ident(git_repository *repo, const char *name, const char
30443044 GIT_ERROR_CHECK_ALLOC (tmp_email );
30453045 }
30463046
3047- tmp_name = git__swap (repo -> ident_name , tmp_name );
3048- tmp_email = git__swap (repo -> ident_email , tmp_email );
3047+ tmp_name = git_atomic_swap (repo -> ident_name , tmp_name );
3048+ tmp_email = git_atomic_swap (repo -> ident_email , tmp_email );
30493049
30503050 git__free (tmp_name );
30513051 git__free (tmp_email );
0 commit comments