Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
01b3404c
Commit
01b3404c
authored
May 31, 2016
by
Guillaume Quintard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document barrier
parent
066b0575
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
2 deletions
+46
-2
vtc_barrier.c
bin/varnishtest/vtc_barrier.c
+46
-2
No files found.
bin/varnishtest/vtc_barrier.c
View file @
01b3404c
...
...
@@ -353,8 +353,52 @@ barrier_sync(struct barrier *b, struct vtclog *vl)
}
}
/**********************************************************************
* Barrier command dispatch
/* SECTION: barrier barrier
*
* NOTE: this can be used from the top-level as well as from client and server
* specifications.
*
* Barriers allows you to synchronize different threads to make sure events
* occur in the right order. It's even possible to use them in VCL.
*
* First, it's necessary to declare the barrier::
*
* barrier bNAME TYPE NUMBER [-cyclic]
*
* With the arguments being:
*
* bNAME
* this is the name of the barrier, used to identify it when you'll
* create sync points. It must start with 'b'.
*
* TYPE
* it can be "cond" (mutex) or "sock" (socket) and sets internal
* behavior. If you don't need VCL synchronization, use cond.
*
* NUMBER
* number of sync point needed to go through the barrier.
*
* \-cyclic
* if present, the barrier will reset itself and be ready for another
* round once gotten through.
*
* Then, to add a sync point::
*
* barrier bNAME sync
*
* This will block the parent thread until the number of sync points for bNAME
* reaches the NUMBER given in the barrier declaration.
*
* If you wish to synchronize the VCL, you need to declare a "sock" barrier.
* This will emit a macro definition named "bNAME_sock" that you can use in
* VCL (after importing the debug vmod)::
*
* debug.barrier_sync("${bNAME_sock}");
*
* This function returns 0 if everything went well and is the equivalent of
* ``barrier bNAME sync`` at the VTC top-level.
*
*
*/
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