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
b0ed61f8
Commit
b0ed61f8
authored
Jul 03, 2014
by
Vicent Marti
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2460 from libgit2/cmn/sched-yield
Move yield to the tests and enable for FreeBSD
parents
193fe9cb
905fb592
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
src/thread-utils.h
+0
-7
tests/threads/diff.c
+14
-0
No files found.
src/thread-utils.h
View file @
b0ed61f8
...
...
@@ -53,12 +53,6 @@ typedef struct {
#endif
#if defined(GIT_WIN32)
#define git_thread_yield() Sleep(0)
#else
#define git_thread_yield() sched_yield()
#endif
/* Pthreads Mutex */
#define git_mutex pthread_mutex_t
#define git_mutex_init(a) pthread_mutex_init(a, NULL)
...
...
@@ -186,7 +180,6 @@ GIT_INLINE(int64_t) git_atomic64_add(git_atomic64 *a, int64_t addend)
#define git_thread unsigned int
#define git_thread_create(thread, attr, start_routine, arg) 0
#define git_thread_join(id, status) (void)0
#define git_thread_yield() (void)0
/* Pthreads Mutex */
#define git_mutex unsigned int
...
...
tests/threads/diff.c
View file @
b0ed61f8
#include "clar_libgit2.h"
#include "thread_helpers.h"
#ifdef GIT_THREADS
# if defined(GIT_WIN32)
# define git_thread_yield() Sleep(0)
# elif defined(__FreeBSD__) || defined(__MidnightBSD__) || defined(__DragonFly__)
# define git_thread_yield() pthread_yield()
# else
# define git_thread_yield() sched_yield()
# endif
#else
# define git_thread_yield() (void)0
#endif
static
git_repository
*
_repo
;
static
git_tree
*
_a
,
*
_b
;
static
git_atomic
_counts
[
4
];
...
...
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