[master] ddeb24214 Add comment about ObjSubscribeEvents() not being atomic.

Poul-Henning Kamp phk at FreeBSD.org
Mon Dec 4 09:12:05 UTC 2023


commit ddeb24214599de85f8e77be72ce9fc29d386a8a7
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Dec 4 09:09:12 2023 +0000

    Add comment about ObjSubscribeEvents() not being atomic.

diff --git a/bin/varnishd/cache/cache_obj.c b/bin/varnishd/cache/cache_obj.c
index d92fc1f0d..2ff54cb8e 100644
--- a/bin/varnishd/cache/cache_obj.c
+++ b/bin/varnishd/cache/cache_obj.c
@@ -672,6 +672,10 @@ static VTAILQ_HEAD(,oev_entry)		oev_list;
 static pthread_rwlock_t			oev_rwl;
 static unsigned				oev_mask;
 
+/*
+ * NB: ObjSubscribeEvents() is not atomic:
+ * oev_mask is checked optimistically in ObjSendEvent()
+ */
 uintptr_t
 ObjSubscribeEvents(obj_event_f *func, void *priv, unsigned mask)
 {


More information about the varnish-commit mailing list