[PATCH bfd] BFD: remove unused spinlock
Zhang Maiyun
me at maiyun.me
Sun Nov 23 20:38:03 CET 2025
Sorry for the noise as the previous email was incorrectly formatted.
This is a very minor patch for the v3.1 branch. Removing the stale
`pthread_spinlock_t` in the BFD structure reduces porting patches.
Patch below:
The only use of the spinlock in `struct bfd_proto` was removed in 38acb415f
and now it should be fine to remove it.
The check for `pthread_spin*` in `aclocal.m4` is also removed
accordingly. This makes it possible to port BFD support to platforms
without spinlocks (e.g. Darwin)
Signed-off-by: Zhang Maiyun <me at maiyun.me>
---
aclocal.m4 | 4 ++--
proto/bfd/bfd.h | 2 --
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4
index dd5cca35..7fc9c995 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -91,8 +91,8 @@ AC_DEFUN([BIRD_CHECK_PTHREADS],
[
pthread_t pt;
pthread_create(&pt, NULL, NULL, NULL);
- pthread_spinlock_t lock;
- pthread_spin_lock(&lock);
+ pthread_mutex_t lock;
+ pthread_mutex_lock(&lock);
]
)
],
diff --git a/proto/bfd/bfd.h b/proto/bfd/bfd.h
index 71f1090d..d8b5f8ea 100644
--- a/proto/bfd/bfd.h
+++ b/proto/bfd/bfd.h
@@ -82,8 +82,6 @@ struct bfd_proto
{
struct proto p;
- pthread_spinlock_t lock;
-
pool *tpool;
struct birdloop *eloop;
--
2.50.1 (Apple Git-155)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 325 bytes
Desc: not available
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20251123/fcd871bc/attachment.sig>
More information about the Bird-users
mailing list