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
427e00c9
Commit
427e00c9
authored
May 27, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate the list of struct waited, a simple count will do.
parent
8b5670dd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
cache_waiter_kqueue.c
bin/varnishd/waiter/cache_waiter_kqueue.c
+5
-7
waiter.h
bin/varnishd/waiter/waiter.h
+0
-1
No files found.
bin/varnishd/waiter/cache_waiter_kqueue.c
View file @
427e00c9
...
...
@@ -54,10 +54,9 @@ struct vwk {
pthread_t
thread
;
double
next
;
int
pipe
[
2
];
VTAILQ_HEAD
(,
waited
)
list
;
struct
lock
mtx
;
unsigned
nwaited
;
int
die
;
struct
lock
mtx
;
};
/*--------------------------------------------------------------------*/
...
...
@@ -116,13 +115,13 @@ vwk_thread(void *priv)
continue
;
}
CAST_OBJ_NOTNULL
(
wp
,
ke
[
j
].
udata
,
WAITED_MAGIC
);
VTAILQ_REMOVE
(
&
vwk
->
list
,
wp
,
list
)
;
vwk
->
nwaited
--
;
if
(
kp
->
flags
&
EV_EOF
)
Wait_Call
(
w
,
wp
,
WAITER_REMCLOSE
,
now
);
else
Wait_Call
(
w
,
wp
,
WAITER_ACTION
,
now
);
}
if
(
VTAILQ_EMPTY
(
&
vwk
->
list
)
&&
vwk
->
die
)
if
(
vwk
->
nwaited
==
0
&&
vwk
->
die
)
break
;
}
Lck_Unlock
(
&
vwk
->
mtx
);
...
...
@@ -143,7 +142,7 @@ vwk_enter(void *priv, struct waited *wp)
CAST_OBJ_NOTNULL
(
vwk
,
priv
,
VWK_MAGIC
);
EV_SET
(
&
ke
,
wp
->
fd
,
EVFILT_READ
,
EV_ADD
|
EV_ONESHOT
,
0
,
0
,
wp
);
Lck_Lock
(
&
vwk
->
mtx
);
VTAILQ_INSERT_TAIL
(
&
vwk
->
list
,
wp
,
list
)
;
vwk
->
nwaited
++
;
Wait_HeapInsert
(
vwk
->
waiter
,
wp
);
AZ
(
kevent
(
vwk
->
kq
,
&
ke
,
1
,
NULL
,
0
,
NULL
));
...
...
@@ -170,7 +169,6 @@ vwk_init(struct waiter *w)
vwk
->
kq
=
kqueue
();
assert
(
vwk
->
kq
>=
0
);
VTAILQ_INIT
(
&
vwk
->
list
);
Lck_New
(
&
vwk
->
mtx
,
lck_misc
);
AZ
(
pipe
(
vwk
->
pipe
));
EV_SET
(
&
ke
,
vwk
->
pipe
[
0
],
EVFILT_READ
,
EV_ADD
,
0
,
0
,
vwk
);
...
...
bin/varnishd/waiter/waiter.h
View file @
427e00c9
...
...
@@ -69,7 +69,6 @@ struct waited {
void
*
ptr
;
const
struct
waitfor
*
waitfor
;
double
idle
;
VTAILQ_ENTRY
(
waited
)
list
;
};
/* cache_waiter.c */
...
...
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