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
a2a17a1b
Commit
a2a17a1b
authored
Feb 22, 2021
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use pthread_equal(3) as POSIX intended.
Spotted by: Rasmus Villemoes
parent
30eb7db8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
cache.h
bin/varnishd/cache/cache.h
+1
-1
vtc_barrier.c
bin/varnishtest/vtc_barrier.c
+1
-1
vtc_log.c
bin/varnishtest/vtc_log.c
+1
-1
vev.c
lib/libvarnish/vev.c
+5
-5
No files found.
bin/varnishd/cache/cache.h
View file @
a2a17a1b
...
...
@@ -591,7 +591,7 @@ void BAN_Abandon(struct ban_proto *b);
/* cache_cli.c [CLI] */
extern
pthread_t
cli_thread
;
#define ASSERT_CLI() do {assert(pthread_
self() == cli_thread
);} while (0)
#define ASSERT_CLI() do {assert(pthread_
equal(pthread_self(), cli_thread)
);} while (0)
/* cache_http.c */
unsigned
HTTP_estimate
(
unsigned
nhttp
);
...
...
bin/varnishtest/vtc_barrier.c
View file @
a2a17a1b
...
...
@@ -77,7 +77,7 @@ barrier_new(const char *name, struct vtclog *vl)
ALLOC_OBJ
(
b
,
BARRIER_MAGIC
);
AN
(
b
);
if
(
pthread_self
()
!=
vtc_thread
)
if
(
!
pthread_equal
(
pthread_self
(),
vtc_thread
)
)
vtc_fatal
(
vl
,
"Barrier %s can only be created on the top thread"
,
name
);
REPLACE
(
b
->
name
,
name
);
...
...
bin/varnishtest/vtc_log.c
View file @
a2a17a1b
...
...
@@ -114,7 +114,7 @@ vtc_logfail(void)
{
vtc_error
=
2
;
if
(
pthread_self
()
!=
vtc_thread
)
if
(
!
pthread_equal
(
pthread_self
(),
vtc_thread
)
)
pthread_exit
(
NULL
);
else
exit
(
fail_out
());
...
...
lib/libvarnish/vev.c
View file @
a2a17a1b
...
...
@@ -221,7 +221,7 @@ VEV_Destroy(struct vev_root **evbp)
struct
vev_root
*
evb
;
TAKE_OBJ_NOTNULL
(
evb
,
evbp
,
VEV_BASE_MAGIC
);
assert
(
evb
->
thread
==
pthread_self
(
));
assert
(
pthread_equal
(
evb
->
thread
,
pthread_self
()
));
free
(
evb
->
pfd
);
free
(
evb
->
pev
);
/* XXX: destroy evb->binheap */
...
...
@@ -255,7 +255,7 @@ VEV_Start(struct vev_root *evb, struct vev *e)
assert
(
e
->
sig
>=
0
);
assert
(
e
->
timeout
>=
0
.
0
);
assert
(
e
->
fd
<
0
||
e
->
fd_flags
);
assert
(
evb
->
thread
==
pthread_self
(
));
assert
(
pthread_equal
(
evb
->
thread
,
pthread_self
()
));
DBG
(
evb
,
"ev_add(%p) fd = %d
\n
"
,
e
,
e
->
fd
);
if
(
vev_get_pfd
(
evb
))
...
...
@@ -311,7 +311,7 @@ VEV_Stop(struct vev_root *evb, struct vev *e)
CHECK_OBJ_NOTNULL
(
e
,
VEV_MAGIC
);
DBG
(
evb
,
"ev_del(%p) fd = %d i=%u L=%d
\n
"
,
e
,
e
->
fd
,
e
->
__binheap_idx
,
evb
->
lpfd
);
assert
(
evb
==
e
->
__vevb
);
assert
(
evb
->
thread
==
pthread_self
(
));
assert
(
pthread_equal
(
evb
->
thread
,
pthread_self
()
));
assert
(
evb
->
pev
[
e
->
__binheap_idx
]
==
e
);
assert
(
e
->
__binheap_idx
!=
VBH_NOIDX
);
...
...
@@ -344,7 +344,7 @@ VEV_Loop(struct vev_root *evb)
int
i
;
CHECK_OBJ_NOTNULL
(
evb
,
VEV_BASE_MAGIC
);
assert
(
evb
->
thread
==
pthread_self
(
));
assert
(
pthread_equal
(
evb
->
thread
,
pthread_self
()
));
do
i
=
VEV_Once
(
evb
);
while
(
i
==
1
);
...
...
@@ -406,7 +406,7 @@ VEV_Once(struct vev_root *evb)
unsigned
u
;
CHECK_OBJ_NOTNULL
(
evb
,
VEV_BASE_MAGIC
);
assert
(
evb
->
thread
==
pthread_self
(
));
assert
(
pthread_equal
(
evb
->
thread
,
pthread_self
()
));
assert
(
evb
->
lpfd
<
evb
->
npfd
);
if
(
evb
->
psig
)
...
...
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