]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Revert "tevent: Fix a race condition"
authorStefan Metzmacher <metze@samba.org>
Mon, 13 Nov 2017 22:29:42 +0000 (23:29 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 14 Nov 2017 11:39:12 +0000 (12:39 +0100)
This reverts commit 6a43b1b17902c8fbc319e13f31f6c9177f38371c.

This will reapplied shortly in the correct order relative to
other backports.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
lib/tevent/tevent_threads.c

index 197ad1dfe41145c94d7634086d6d8417eea85fd5..8197323af020e43444415da0f3d42191e8590452 100644 (file)
@@ -434,7 +434,7 @@ void _tevent_threaded_schedule_immediate(struct tevent_threaded_context *tctx,
 {
 #ifdef HAVE_PTHREAD
        struct tevent_context *ev;
-       int ret, wakeup_fd;
+       int ret;
 
        ret = pthread_mutex_lock(&tctx->event_ctx_mutex);
        if (ret != 0) {
@@ -442,7 +442,6 @@ void _tevent_threaded_schedule_immediate(struct tevent_threaded_context *tctx,
        }
 
        ev = tctx->event_ctx;
-       wakeup_fd = tctx->wakeup_fd;
 
        ret = pthread_mutex_unlock(&tctx->event_ctx_mutex);
        if (ret != 0) {
@@ -490,7 +489,7 @@ void _tevent_threaded_schedule_immediate(struct tevent_threaded_context *tctx,
         * than a noncontended one. So I'd opt for the lower footprint
         * initially. Maybe we have to change that later.
         */
-       tevent_common_wakeup_fd(wakeup_fd);
+       tevent_common_wakeup_fd(tctx->wakeup_fd);
 #else
        /*
         * tevent_threaded_context_create() returned NULL with ENOSYS...