Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
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
Chen Yisong
lxc
Commits
26891336
Unverified
Commit
26891336
authored
Jan 29, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync: export sync_wait() and sync_wake()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
74ce42b5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
sync.c
src/lxc/sync.c
+8
-8
sync.h
src/lxc/sync.h
+2
-0
No files found.
src/lxc/sync.c
View file @
26891336
...
...
@@ -17,7 +17,7 @@
lxc_log_define
(
sync
,
lxc
);
static
int
__
sync_wait
(
int
fd
,
int
sequence
)
int
sync_wait
(
int
fd
,
int
sequence
)
{
int
sync
=
-
1
;
ssize_t
ret
;
...
...
@@ -41,7 +41,7 @@ static int __sync_wait(int fd, int sequence)
return
0
;
}
static
int
__
sync_wake
(
int
fd
,
int
sequence
)
int
sync_wake
(
int
fd
,
int
sequence
)
{
int
sync
=
sequence
;
...
...
@@ -53,10 +53,10 @@ static int __sync_wake(int fd, int sequence)
static
int
__sync_barrier
(
int
fd
,
int
sequence
)
{
if
(
__
sync_wake
(
fd
,
sequence
))
if
(
sync_wake
(
fd
,
sequence
))
return
-
1
;
return
__
sync_wait
(
fd
,
sequence
+
1
);
return
sync_wait
(
fd
,
sequence
+
1
);
}
int
lxc_sync_barrier_parent
(
struct
lxc_handler
*
handler
,
int
sequence
)
...
...
@@ -76,25 +76,25 @@ int lxc_sync_barrier_child(struct lxc_handler *handler, int sequence)
int
lxc_sync_wake_parent
(
struct
lxc_handler
*
handler
,
int
sequence
)
{
TRACE
(
"Child waking parent with sequence %s"
,
sync_to_string
(
sequence
));
return
__
sync_wake
(
handler
->
sync_sock
[
0
],
sequence
);
return
sync_wake
(
handler
->
sync_sock
[
0
],
sequence
);
}
int
lxc_sync_wait_parent
(
struct
lxc_handler
*
handler
,
int
sequence
)
{
TRACE
(
"Parent waiting for child with sequence %s"
,
sync_to_string
(
sequence
));
return
__
sync_wait
(
handler
->
sync_sock
[
0
],
sequence
);
return
sync_wait
(
handler
->
sync_sock
[
0
],
sequence
);
}
int
lxc_sync_wait_child
(
struct
lxc_handler
*
handler
,
int
sequence
)
{
TRACE
(
"Child waiting for parent with sequence %s"
,
sync_to_string
(
sequence
));
return
__
sync_wait
(
handler
->
sync_sock
[
1
],
sequence
);
return
sync_wait
(
handler
->
sync_sock
[
1
],
sequence
);
}
int
lxc_sync_wake_child
(
struct
lxc_handler
*
handler
,
int
sequence
)
{
TRACE
(
"Child waking parent with sequence %s"
,
sync_to_string
(
sequence
));
return
__
sync_wake
(
handler
->
sync_sock
[
1
],
sequence
);
return
sync_wake
(
handler
->
sync_sock
[
1
],
sequence
);
}
int
lxc_sync_init
(
struct
lxc_handler
*
handler
)
...
...
src/lxc/sync.h
View file @
26891336
...
...
@@ -58,5 +58,7 @@ __hidden extern int lxc_sync_wake_parent(struct lxc_handler *, int);
__hidden
extern
int
lxc_sync_wait_parent
(
struct
lxc_handler
*
,
int
);
__hidden
extern
int
lxc_sync_barrier_parent
(
struct
lxc_handler
*
,
int
);
__hidden
extern
int
lxc_sync_barrier_child
(
struct
lxc_handler
*
,
int
);
__hidden
extern
int
sync_wait
(
int
fd
,
int
sequence
);
__hidden
extern
int
sync_wake
(
int
fd
,
int
sequence
);
#endif
/* __LXC_SYNC_H */
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