From: Ian Jackson Subject: Re: [PATCH 8/9] libxl: Introduce libxl__ev_devstate Date: Wed, 25 Jan 2012 14:49:41 +0000 Message-ID: <20256.5765.77301.338576@mariner.uk.xensource.com> References: <1326482728-10733-1-git-send-email-ian.jackson@eu.citrix.com> <1326482728-10733-9-git-send-email-ian.jackson@eu.citrix.com> <1326970442.17599.53.camel@zakaz.uk.xensource.com> <20254.60260.642300.195152@mariner.uk.xensource.com> <1327489070.24561.276.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1327489070.24561.276.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [Xen-devel] [PATCH 8/9] libxl: Introduce libxl__ev_devstate"): > On Tue, 2012-01-24 at 17:33 +0000, Ian Jackson wrote: > > So, no. When the timeout happens, the ev xswatch is deregistered and > > can thereafter no longer generate callbacks. If there are any > > xenstore watch events in the pipeline for deregistered ev_xswatch's, > > they're discarded by watchfd_callback. > > What happens if the watch occurs and is delivered (in a different > thread) e.g. just before devstate_timeout calls > libxl__ev_devstate_cancel? The watch callback will be delivered but we > will unconditionally go on to deliver the cancel callback as well. All of these callback functions are called with the lock held, so there aren't any of these kind of races. Ian.