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
110b8e71
Commit
110b8e71
authored
Dec 26, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use WRK_BgThread() instead of hand-rolling
parent
41608b69
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
hash_critbit.c
bin/varnishd/hash/hash_critbit.c
+6
-11
No files found.
bin/varnishd/hash/hash_critbit.c
View file @
110b8e71
...
...
@@ -344,17 +344,13 @@ static struct cli_proto hcb_cmds[] = {
/*--------------------------------------------------------------------*/
static
void
*
hcb_cleaner
(
void
*
priv
)
static
void
*
__match_proto__
(
bgthread_t
)
hcb_cleaner
(
struct
sess
*
sp
,
void
*
priv
)
{
struct
hcb_y
*
y
,
*
y2
;
struct
worker
wrk
;
struct
worker
*
wrk
=
sp
->
wrk
;
struct
objhead
*
oh
,
*
oh2
;
memset
(
&
wrk
,
0
,
sizeof
wrk
);
wrk
.
magic
=
WORKER_MAGIC
;
THR_SetName
(
"hcb_cleaner"
);
(
void
)
priv
;
while
(
1
)
{
VSTAILQ_FOREACH_SAFE
(
y
,
&
dead_y
,
list
,
y2
)
{
...
...
@@ -363,13 +359,13 @@ hcb_cleaner(void *priv)
}
VTAILQ_FOREACH_SAFE
(
oh
,
&
dead_h
,
hoh_list
,
oh2
)
{
VTAILQ_REMOVE
(
&
dead_h
,
oh
,
hoh_list
);
HSH_DeleteObjHead
(
&
wrk
,
oh
);
HSH_DeleteObjHead
(
wrk
,
oh
);
}
Lck_Lock
(
&
hcb_mtx
);
VSTAILQ_CONCAT
(
&
dead_y
,
&
cool_y
);
VTAILQ_CONCAT
(
&
dead_h
,
&
cool_h
,
hoh_list
);
Lck_Unlock
(
&
hcb_mtx
);
WRK_SumStat
(
&
wrk
);
WRK_SumStat
(
wrk
);
VTIM_sleep
(
cache_param
->
critbit_cooloff
);
}
NEEDLESS_RETURN
(
NULL
);
...
...
@@ -386,8 +382,7 @@ hcb_start(void)
(
void
)
oh
;
CLI_AddFuncs
(
hcb_cmds
);
Lck_New
(
&
hcb_mtx
,
lck_hcb
);
/* XXX: use WRK_BgThread */
AZ
(
pthread_create
(
&
tp
,
NULL
,
hcb_cleaner
,
NULL
));
WRK_BgThread
(
&
tp
,
"hcb-cleaner"
,
hcb_cleaner
,
NULL
);
memset
(
&
hcb_root
,
0
,
sizeof
hcb_root
);
hcb_build_bittbl
();
}
...
...
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