]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BFD: remove unused spinlock
authorZhang Maiyun via Bird-users <bird-users@network.cz>
Sun, 23 Nov 2025 19:38:03 +0000 (14:38 -0500)
committerMaria Matejka <mq@ucw.cz>
Wed, 26 Nov 2025 09:33:11 +0000 (10:33 +0100)
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@maiyun.me>
aclocal.m4
proto/bfd/bfd.h

index dd5cca359662338f3025d2d0d617aa33f334aa79..7fc9c9953d23159aae8818bdc2a0b8d437a3de5a 100644 (file)
@@ -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);
            ]
          )
        ],
index 71f1090dfe25232cfb71c3ff7f884be97f301e6e..d8b5f8ea3bfbdd0a07656852c230de63a4417aea 100644 (file)
@@ -82,8 +82,6 @@ struct bfd_proto
 {
   struct proto p;
 
-  pthread_spinlock_t lock;
-
   pool *tpool;
 
   struct birdloop *eloop;