Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jan 2004 17:15:37 +0100
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Pawel Jakub Dawidek <nick@garage.freebsd.pl>
Cc:        Lukas Ertl <l.ertl@univie.ac.at>
Subject:   Re: Preventing deadlocks on the event queue. 
Message-ID:  <66984.1075133737@critter.freebsd.dk>
In-Reply-To: Your message of "Mon, 26 Jan 2004 17:13:00 %2B0100." <20040126161300.GJ565@garage.freebsd.pl> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20040126161300.GJ565@garage.freebsd.pl>, Pawel Jakub Dawidek writes

>On Mon, Jan 26, 2004 at 04:50:38PM +0100, Lukas Ertl wrote:
>+> > So, I think I've found clever way to prevents deadlock caused by
>+> > calling g_waitfor_event() from an event.
>+> >
>+> > My idea is to check if curthread in g_waitfor_event() is a g_event thr=
>ead.
>+> >
>+> > 	http://garage.freebsd.pl/patches/geom_event_deadlock.patch
>+>=20
>+> Do you really want to make this a separate function?  Since it's just a
>+> one-line comparison, wouldn't a macro suffice?
>
>I want to avoid exporting 'g_event_proc' from geom_kern.c (it is declareted
>staticaly there).

Right, g_event_proc should stay local to geom_kern.c if at all possible.

I'm still trying to see if I can find a more elegant way to do it, but
curproc/curthread is probably the trick.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?66984.1075133737>