Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
1adb8410
Unverified
Commit
1adb8410
authored
Dec 05, 2020
by
Edward Thomson
Committed by
GitHub
Dec 05, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5719 from libgit2/ethomson/nothreads
Thread-free implementation
parents
87e4597c
8f305326
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
24 deletions
+34
-24
.github/workflows/nightly.yml
+8
-0
src/pack-objects.c
+1
-1
src/runtime.c
+2
-2
src/thread-utils.h
+19
-21
src/util.h
+2
-0
tests/pack/threadsafety.c
+2
-0
No files found.
.github/workflows/nightly.yml
View file @
1adb8410
...
...
@@ -51,6 +51,14 @@ jobs:
CMAKE_OPTIONS
:
-DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
CMAKE_GENERATOR
:
Ninja
os
:
ubuntu-latest
-
# Xenial, GCC, thread-free
container
:
name
:
xenial
env
:
CC
:
gcc
CMAKE_OPTIONS
:
-DTHREADSAFE=OFF -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
CMAKE_GENERATOR
:
Ninja
os
:
ubuntu-latest
-
# Focal, Clang 10, mbedTLS, MemorySanitizer
container
:
name
:
focal
...
...
src/pack-objects.c
View file @
1adb8410
...
...
@@ -50,7 +50,7 @@ struct walk_object {
#ifdef GIT_THREADS
# define GIT_PACKBUILDER__MUTEX_OP(pb, mtx, op) git_mutex_##op(&(pb)->mtx)
#else
# define GIT_PACKBUILDER__MUTEX_OP(pb, mtx, op)
GIT_UNUSED(pb
)
# define GIT_PACKBUILDER__MUTEX_OP(pb, mtx, op)
git__noop(
)
#endif
#define git_packbuilder__cache_lock(pb) GIT_PACKBUILDER__MUTEX_OP(pb, cache_mutex, lock)
...
...
src/runtime.c
View file @
1adb8410
...
...
@@ -103,8 +103,8 @@ GIT_INLINE(int) init_unlock(void)
# error unknown threading model
#else
# define init_lock() git__
_
noop()
# define init_unlock() git__
_
noop()
# define init_lock() git__noop()
# define init_unlock() git__noop()
#endif
...
...
src/thread-utils.h
View file @
1adb8410
...
...
@@ -235,38 +235,36 @@ GIT_INLINE(int64_t) git_atomic64_get(git_atomic64 *a)
#else
GIT_INLINE
(
int
)
git___noop
(
void
)
{
return
0
;
}
#define git_threads_global_init git___noop
#define git_threads_global_init git__noop
#define git_thread unsigned int
#define git_thread_create(thread, start_routine, arg) git__
_
noop()
#define git_thread_join(id, status) git__
_
noop()
#define git_thread_create(thread, start_routine, arg) git__noop()
#define git_thread_join(id, status) git__noop()
/* Pthreads Mutex */
#define git_mutex unsigned int
#define git_mutex_init(a) git__
_
noop()
#define git_mutex_init(a) git__
_
noop()
#define git_mutex_lock(a) git__
_
noop()
#define git_mutex_unlock(a) git__
_
noop()
#define git_mutex_free(a) git__
_
noop()
#define git_mutex_init(a) git__noop()
#define git_mutex_init(a) git__noop()
#define git_mutex_lock(a) git__noop()
#define git_mutex_unlock(a) git__noop()
#define git_mutex_free(a) git__noop()
/* Pthreads condition vars */
#define git_cond unsigned int
#define git_cond_init(c) git__
_
noop()
#define git_cond_free(c) git__
_
noop()
#define git_cond_wait(c, l) git__
_
noop()
#define git_cond_signal(c) git__
_
noop()
#define git_cond_broadcast(c) git__
_
noop()
#define git_cond_init(c) git__noop()
#define git_cond_free(c) git__noop()
#define git_cond_wait(c, l) git__noop()
#define git_cond_signal(c) git__noop()
#define git_cond_broadcast(c) git__noop()
/* Pthreads rwlock */
#define git_rwlock unsigned int
#define git_rwlock_init(a) git__
_
noop()
#define git_rwlock_rdlock(a) git__
_
noop()
#define git_rwlock_rdunlock(a) git__
_
noop()
#define git_rwlock_wrlock(a) git__
_
noop()
#define git_rwlock_wrunlock(a) git__
_
noop()
#define git_rwlock_free(a) git__
_
noop()
#define git_rwlock_init(a) git__noop()
#define git_rwlock_rdlock(a) git__noop()
#define git_rwlock_rdunlock(a) git__noop()
#define git_rwlock_wrlock(a) git__noop()
#define git_rwlock_wrunlock(a) git__noop()
#define git_rwlock_free(a) git__noop()
#define GIT_RWLOCK_STATIC_INIT 0
...
...
src/util.h
View file @
1adb8410
...
...
@@ -414,6 +414,8 @@ GIT_INLINE(double) git__timer(void)
extern
int
git__getenv
(
git_buf
*
out
,
const
char
*
name
);
GIT_INLINE
(
int
)
git__noop
(
void
)
{
return
0
;
}
#include "alloc.h"
#endif
tests/pack/threadsafety.c
View file @
1adb8410
...
...
@@ -20,6 +20,7 @@ void test_pack_threadsafety__cleanup(void)
cl_git_pass
(
git_libgit2_opts
(
GIT_OPT_SET_MWINDOW_FILE_LIMIT
,
original_mwindow_file_limit
));
}
#ifdef GIT_THREADS
static
void
*
get_status
(
void
*
arg
)
{
const
char
*
repo_path
=
(
const
char
*
)
arg
;
...
...
@@ -33,6 +34,7 @@ static void *get_status(void *arg)
return
NULL
;
}
#endif
void
test_pack_threadsafety__open_repo_in_multiple_threads
(
void
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment