|
From: | Jason Wang |
Subject: | Re: [Qemu-devel] [PATCH 1/3] colo-compare: serialize compare thread's initialization with main thread |
Date: | Tue, 25 Apr 2017 16:41:45 +0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 2017年04月24日 14:03, Hailiang Zhang wrote:
On 2017/4/24 12:10, Jason Wang wrote:On 2017年04月20日 15:46, zhanghailiang wrote:We call qemu_chr_fe_set_handlers() in colo-compare thread, it is used to detach watched fd from default main context, so it has chance to handle the same watched fd with main thread concurrently, which will trigger an error report:"qemu-char.c:918: io_watch_poll_finalize: Assertion `iwp->src == ((void *)0)' failed."Anyway to prevent fd from being handled by main thread before creating colo thread? Using semaphore seems not elegant.So how about calling qemu_mutex_lock_iothread() before qemu_chr_fe_set_handlers() ?
Looks better, but I needs more information e.g how main thread can touch it? Thanks
[Prev in Thread] | Current Thread | [Next in Thread] |