module/mpd: refresh thread only resets refresh_abort_fd if it's "ours"

That is, we only reset it if the module main thread haven't already
done so (and quite possibly created another eventfd).
This commit is contained in:
Daniel Eklöf 2018-12-28 14:08:45 +01:00
parent b40069616c
commit d8274c2c9c

View file

@ -350,7 +350,8 @@ refresh_in_thread(void *arg)
/* Close abort eventfd */ /* Close abort eventfd */
mtx_lock(&mod->lock); mtx_lock(&mod->lock);
close(abort_fd); close(abort_fd);
m->refresh_abort_fd = 0; if (m->refresh_abort_fd == abort_fd)
m->refresh_abort_fd = -1;
mtx_unlock(&mod->lock); mtx_unlock(&mod->lock);
/* Aborted? */ /* Aborted? */