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
d0341485
Commit
d0341485
authored
Jan 21, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the scaffolding for destroying waiters, now I just need to make it
also work.
parent
4776a39f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
cache_waiter.c
bin/varnishd/waiter/cache_waiter.c
+15
-0
waiter.h
bin/varnishd/waiter/waiter.h
+1
-0
waiter_priv.h
bin/varnishd/waiter/waiter_priv.h
+2
-0
No files found.
bin/varnishd/waiter/cache_waiter.c
View file @
d0341485
...
...
@@ -112,12 +112,27 @@ Wait_New(waiter_handle_f *func, volatile double *tmo)
Lck_Lock
(
&
wait_mtx
);
VTAILQ_INSERT_TAIL
(
&
waiters
,
w
,
list
);
nwaiters
++
;
/* We assume all waiters either use pipes or don't use pipes */
if
(
w
->
pipes
[
1
]
>=
0
&&
nwaiters
==
1
)
AZ
(
pthread_create
(
&
wait_thr
,
NULL
,
wait_poker_thread
,
NULL
));
Lck_Unlock
(
&
wait_mtx
);
return
(
w
);
}
void
Wait_Destroy
(
struct
waiter
**
wp
)
{
struct
waiter
*
w
;
AN
(
wp
);
w
=
*
wp
;
*
wp
=
NULL
;
CHECK_OBJ_NOTNULL
(
w
,
WAITER_MAGIC
);
AN
(
w
->
impl
->
fini
);
w
->
impl
->
fini
(
w
);
}
void
Wait_UsePipe
(
struct
waiter
*
w
)
{
...
...
bin/varnishd/waiter/waiter.h
View file @
d0341485
...
...
@@ -58,6 +58,7 @@ typedef void waiter_handle_f(struct waited *, enum wait_event, double now);
/* cache_waiter.c */
int
Wait_Enter
(
const
struct
waiter
*
,
struct
waited
*
);
struct
waiter
*
Wait_New
(
waiter_handle_f
*
,
volatile
double
*
timeout
);
void
Wait_Destroy
(
struct
waiter
**
);
const
char
*
Wait_GetName
(
void
);
void
Wait_Init
(
void
);
...
...
bin/varnishd/waiter/waiter_priv.h
View file @
d0341485
...
...
@@ -50,6 +50,7 @@ struct waiter {
};
typedef
void
waiter_init_f
(
struct
waiter
*
);
typedef
void
waiter_fini_f
(
struct
waiter
*
);
typedef
int
waiter_pass_f
(
void
*
priv
,
struct
waited
*
);
typedef
void
waiter_inject_f
(
const
struct
waiter
*
,
struct
waited
*
);
typedef
void
waiter_evict_f
(
const
struct
waiter
*
,
struct
waited
*
);
...
...
@@ -57,6 +58,7 @@ typedef void waiter_evict_f(const struct waiter *, struct waited *);
struct
waiter_impl
{
const
char
*
name
;
waiter_init_f
*
init
;
waiter_fini_f
*
fini
;
waiter_pass_f
*
pass
;
waiter_inject_f
*
inject
;
waiter_evict_f
*
evict
;
...
...
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