]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
watch_fd also requires thread->fdlock[lockid] to be held
authorMark Andrews <marka@isc.org>
Wed, 2 Sep 2020 04:42:47 +0000 (14:42 +1000)
committerMark Andrews <marka@isc.org>
Wed, 2 Sep 2020 21:14:45 +0000 (07:14 +1000)
(cherry picked from commit 22f499cdc4f0f683b79d17a6b375df4f1ee4c7cc)

lib/isc/unix/socket.c

index 3621009044a81db9cd9226de5eb30d7f122afc97..11ee532e1dd11c8efac27f0ebb49b0f3ee3f0934 100644 (file)
@@ -892,7 +892,6 @@ wakeup_socket(isc__socketthread_t *thread, int fd, int msg) {
                UNLOCK(&thread->fdlock[lockid]);
                return;
        }
-       UNLOCK(&thread->fdlock[lockid]);
 
        /*
         * Set requested bit.
@@ -909,6 +908,7 @@ wakeup_socket(isc__socketthread_t *thread, int fd, int msg) {
                              "failed to start watching FD (%d): %s", fd,
                              isc_result_totext(result));
        }
+       UNLOCK(&thread->fdlock[lockid]);
 }
 
 /*