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
3e2a73bc
Commit
3e2a73bc
authored
Oct 12, 2021
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Brute force rename Lck_CondWait() to Lck_CondWaitUntil()
parent
c4ceb2d0
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
18 additions
and
18 deletions
+18
-18
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_backend_probe.c
bin/varnishd/cache/cache_backend_probe.c
+2
-2
cache_ban_lurker.c
bin/varnishd/cache/cache_ban_lurker.c
+1
-1
cache_conn_pool.c
bin/varnishd/cache/cache_conn_pool.c
+1
-1
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+1
-1
cache_expire.c
bin/varnishd/cache/cache_expire.c
+1
-1
cache_lck.c
bin/varnishd/cache/cache_lck.c
+1
-1
cache_obj.c
bin/varnishd/cache/cache_obj.c
+2
-2
cache_wrk.c
bin/varnishd/cache/cache_wrk.c
+4
-4
cache_http2_proto.c
bin/varnishd/http2/cache_http2_proto.c
+1
-1
cache_http2_send.c
bin/varnishd/http2/cache_http2_send.c
+2
-2
cache_http2_session.c
bin/varnishd/http2/cache_http2_session.c
+1
-1
No files found.
bin/varnishd/cache/cache.h
View file @
3e2a73bc
...
...
@@ -690,7 +690,7 @@ extern pthread_mutexattr_t mtxattr_errorcheck;
/* public interface: */
void
Lck_Delete
(
struct
lock
*
lck
);
int
Lck_CondWait
(
pthread_cond_t
*
cond
,
struct
lock
*
lck
,
vtim_real
);
int
Lck_CondWait
Until
(
pthread_cond_t
*
cond
,
struct
lock
*
lck
,
vtim_real
);
#define Lck_New(a, b) Lck__New(a, b, #b)
#define Lck_Lock(a) Lck__Lock(a, __func__, __LINE__)
...
...
bin/varnishd/cache/cache_backend_probe.c
View file @
3e2a73bc
...
...
@@ -475,11 +475,11 @@ vbp_thread(struct worker *wrk, void *priv)
vt
=
VBH_root
(
vbp_heap
);
if
(
vt
==
NULL
)
{
nxt
=
8
.
192
+
now
;
(
void
)
Lck_CondWait
(
&
vbp_cond
,
&
vbp_mtx
,
nxt
);
(
void
)
Lck_CondWait
Until
(
&
vbp_cond
,
&
vbp_mtx
,
nxt
);
}
else
if
(
vt
->
due
>
now
)
{
nxt
=
vt
->
due
;
vt
=
NULL
;
(
void
)
Lck_CondWait
(
&
vbp_cond
,
&
vbp_mtx
,
nxt
);
(
void
)
Lck_CondWait
Until
(
&
vbp_cond
,
&
vbp_mtx
,
nxt
);
}
else
{
VBH_delete
(
vbp_heap
,
vt
->
heap_idx
);
vt
->
due
=
now
+
vt
->
interval
;
...
...
bin/varnishd/cache/cache_ban_lurker.c
View file @
3e2a73bc
...
...
@@ -430,7 +430,7 @@ ban_lurker(struct worker *wrk, void *priv)
Lck_Lock
(
&
ban_mtx
);
if
(
gen
==
ban_generation
)
{
Pool_Sumstat
(
wrk
);
(
void
)
Lck_CondWait
(
&
ban_lurker_cond
,
&
ban_mtx
,
d
);
(
void
)
Lck_CondWait
Until
(
&
ban_lurker_cond
,
&
ban_mtx
,
d
);
ban_batch
=
0
;
}
gen
=
ban_generation
;
...
...
bin/varnishd/cache/cache_conn_pool.c
View file @
3e2a73bc
...
...
@@ -500,7 +500,7 @@ VCP_Wait(struct worker *wrk, struct pfd *pfd, vtim_real tmo)
assert
(
pfd
->
cond
==
&
wrk
->
cond
);
Lck_Lock
(
&
cp
->
mtx
);
while
(
pfd
->
state
==
PFD_STATE_STOLEN
)
{
r
=
Lck_CondWait
(
&
wrk
->
cond
,
&
cp
->
mtx
,
tmo
);
r
=
Lck_CondWait
Until
(
&
wrk
->
cond
,
&
cp
->
mtx
,
tmo
);
if
(
r
!=
0
)
{
if
(
r
==
EINTR
)
continue
;
...
...
bin/varnishd/cache/cache_esi_deliver.c
View file @
3e2a73bc
...
...
@@ -202,7 +202,7 @@ ved_include(struct req *preq, const char *src, const char *host,
assert
(
s
==
REQ_FSM_DISEMBARK
);
Lck_Lock
(
&
sp
->
mtx
);
if
(
!
ecx
->
woken
)
(
void
)
Lck_CondWait
(
(
void
)
Lck_CondWait
Until
(
&
ecx
->
preq
->
wrk
->
cond
,
&
sp
->
mtx
,
0
);
Lck_Unlock
(
&
sp
->
mtx
);
AZ
(
req
->
wrk
);
...
...
bin/varnishd/cache/cache_expire.c
View file @
3e2a73bc
...
...
@@ -419,7 +419,7 @@ exp_thread(struct worker *wrk, void *priv)
}
else
if
(
tnext
>
t
)
{
VSL_Flush
(
&
ep
->
vsl
,
0
);
Pool_Sumstat
(
wrk
);
(
void
)
Lck_CondWait
(
&
ep
->
condvar
,
&
ep
->
mtx
,
tnext
);
(
void
)
Lck_CondWait
Until
(
&
ep
->
condvar
,
&
ep
->
mtx
,
tnext
);
}
Lck_Unlock
(
&
ep
->
mtx
);
...
...
bin/varnishd/cache/cache_lck.c
View file @
3e2a73bc
...
...
@@ -208,7 +208,7 @@ Lck__Owned(const struct lock *lck)
}
int
v_matchproto_
()
Lck_CondWait
(
pthread_cond_t
*
cond
,
struct
lock
*
lck
,
vtim_real
when
)
Lck_CondWait
Until
(
pthread_cond_t
*
cond
,
struct
lock
*
lck
,
vtim_real
when
)
{
struct
ilck
*
ilck
;
struct
timespec
ts
;
...
...
bin/varnishd/cache/cache_obj.c
View file @
3e2a73bc
...
...
@@ -257,7 +257,7 @@ ObjWaitExtend(const struct worker *wrk, const struct objcore *oc, uint64_t l)
assert
(
l
<=
rv
||
oc
->
boc
->
state
==
BOS_FAILED
);
if
(
rv
>
l
||
oc
->
boc
->
state
>=
BOS_FINISHED
)
break
;
(
void
)
Lck_CondWait
(
&
oc
->
boc
->
cond
,
&
oc
->
boc
->
mtx
,
0
);
(
void
)
Lck_CondWait
Until
(
&
oc
->
boc
->
cond
,
&
oc
->
boc
->
mtx
,
0
);
}
rv
=
oc
->
boc
->
len_so_far
;
Lck_Unlock
(
&
oc
->
boc
->
mtx
);
...
...
@@ -307,7 +307,7 @@ ObjWaitState(const struct objcore *oc, enum boc_state_e want)
while
(
1
)
{
if
(
oc
->
boc
->
state
>=
want
)
break
;
(
void
)
Lck_CondWait
(
&
oc
->
boc
->
cond
,
&
oc
->
boc
->
mtx
,
0
);
(
void
)
Lck_CondWait
Until
(
&
oc
->
boc
->
cond
,
&
oc
->
boc
->
mtx
,
0
);
}
Lck_Unlock
(
&
oc
->
boc
->
mtx
);
}
...
...
bin/varnishd/cache/cache_wrk.c
View file @
3e2a73bc
...
...
@@ -42,7 +42,7 @@
*
* In our case, any worker thread which we wake up comes from the idle queue,
* where it put itself under the mutex, releasing that mutex implicitly via
* Lck_CondWait() (which calls some variant of pthread_cond_wait). So we avoid
* Lck_CondWait
Until
() (which calls some variant of pthread_cond_wait). So we avoid
* additional mutex contention knowing that any worker thread on the idle queue
* is blocking on the cv.
*
...
...
@@ -440,7 +440,7 @@ Pool_Work_Thread(struct pool *pp, struct worker *wrk)
tmo
=
now
+
1
.;
else
tmo
=
now
+
60
.;
(
void
)
Lck_CondWait
(
&
wrk
->
cond
,
&
pp
->
mtx
,
tmo
);
(
void
)
Lck_CondWait
Until
(
&
wrk
->
cond
,
&
pp
->
mtx
,
tmo
);
if
(
wrk
->
task
->
func
!=
NULL
)
{
/* We have been handed a new task */
tpx
=
*
wrk
->
task
;
...
...
@@ -697,13 +697,13 @@ pool_herder(void *priv)
if
(
pp
->
lqueue
==
0
)
{
if
(
DO_DEBUG
(
DBG_VTC_MODE
))
delay
=
0
.
5
;
r
=
Lck_CondWait
(
&
pp
->
herder_cond
,
&
pp
->
mtx
,
r
=
Lck_CondWait
Until
(
&
pp
->
herder_cond
,
&
pp
->
mtx
,
VTIM_real
()
+
delay
);
}
else
if
(
pp
->
nthr
>=
cache_param
->
wthread_max
)
{
/* XXX: unsafe counters */
if
(
r
!=
ETIMEDOUT
)
VSC_C_main
->
threads_limited
++
;
r
=
Lck_CondWait
(
&
pp
->
herder_cond
,
&
pp
->
mtx
,
r
=
Lck_CondWait
Until
(
&
pp
->
herder_cond
,
&
pp
->
mtx
,
VTIM_real
()
+
1
.
0
);
}
Lck_Unlock
(
&
pp
->
mtx
);
...
...
bin/varnishd/http2/cache_http2_proto.c
View file @
3e2a73bc
...
...
@@ -1038,7 +1038,7 @@ h2_vfp_body(struct vfp_ctx *vc, struct vfp_entry *vfe, void *ptr, ssize_t *lp)
if
(
retval
!=
VFP_OK
||
l
>
0
)
break
;
i
=
Lck_CondWait
(
r2
->
cond
,
&
h2
->
sess
->
mtx
,
i
=
Lck_CondWait
Until
(
r2
->
cond
,
&
h2
->
sess
->
mtx
,
VTIM_real
()
+
SESS_TMO
(
h2
->
sess
,
timeout_idle
));
if
(
i
==
ETIMEDOUT
)
{
retval
=
VFP_ERROR
;
...
...
bin/varnishd/http2/cache_http2_send.c
View file @
3e2a73bc
...
...
@@ -59,7 +59,7 @@ h2_cond_wait(pthread_cond_t *cond, struct h2_sess *h2, struct h2_req *r2)
if
(
cache_param
->
idle_send_timeout
>
0
.)
when
=
now
+
cache_param
->
idle_send_timeout
;
r
=
Lck_CondWait
(
cond
,
&
h2
->
sess
->
mtx
,
when
);
r
=
Lck_CondWait
Until
(
cond
,
&
h2
->
sess
->
mtx
,
when
);
assert
(
r
==
0
||
r
==
ETIMEDOUT
);
now
=
VTIM_real
();
...
...
@@ -100,7 +100,7 @@ h2_send_get_locked(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
r2
->
wrk
=
wrk
;
VTAILQ_INSERT_TAIL
(
&
h2
->
txqueue
,
r2
,
tx_list
);
while
(
!
H2_SEND_HELD
(
h2
,
r2
))
AZ
(
Lck_CondWait
(
&
wrk
->
cond
,
&
h2
->
sess
->
mtx
,
0
));
AZ
(
Lck_CondWait
Until
(
&
wrk
->
cond
,
&
h2
->
sess
->
mtx
,
0
));
r2
->
wrk
=
NULL
;
}
...
...
bin/varnishd/http2/cache_http2_session.c
View file @
3e2a73bc
...
...
@@ -429,7 +429,7 @@ h2_new_session(struct worker *wrk, void *arg)
VTAILQ_FOREACH
(
r2
,
&
h2
->
streams
,
list
)
VSLb
(
h2
->
vsl
,
SLT_Debug
,
"ST %u %d"
,
r2
->
stream
,
r2
->
state
);
(
void
)
Lck_CondWait
(
h2
->
cond
,
&
h2
->
sess
->
mtx
,
VTIM_real
()
+
.
1
);
(
void
)
Lck_CondWait
Until
(
h2
->
cond
,
&
h2
->
sess
->
mtx
,
VTIM_real
()
+
.
1
);
Lck_Unlock
(
&
h2
->
sess
->
mtx
);
}
h2
->
cond
=
NULL
;
...
...
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