From: Ian Campbell Subject: Re: [PATCH 03/20] libxl: Fix eventloop_iteration over-locking Date: Tue, 20 Mar 2012 09:44:55 +0000 Message-ID: <1332236695.9223.147.camel@zakaz.uk.xensource.com> References: <1331915215-10477-1-git-send-email-ian.jackson@eu.citrix.com> <1331915215-10477-4-git-send-email-ian.jackson@eu.citrix.com> <1332178278.9223.142.camel@zakaz.uk.xensource.com> <20327.29029.319573.228826@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20327.29029.319573.228826@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Mon, 2012-03-19 at 17:48 +0000, Ian Jackson wrote: > Ian Campbell writes ("Re: [Xen-devel] [PATCH 03/20] libxl: Fix eventloop_iteration over-locking"): > > A comment in eventloop_iteration along the lines "no need to lock, we > > must be called with lock held once" might be nice to prevent future > > re-occurences of the same error. > > You don't see it in this patch, but there's something along these > lines already. Let me add some more context: > > > > @@ -1058,8 +1058,6 @@ static int eventloop_iteration(libxl__egc *egc, libxl__poller *poller) { > static int eventloop_iteration(libxl__egc *egc, libxl__poller *poller) { > /* The CTX must be locked EXACTLY ONCE so that this function > * can unlock it when it polls. > */ Brilliant, thanks! > EGC_GC; > > > int rc; > > > struct timeval now; > > > > > > - CTX_LOCK; > > > - > > Ian.