From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 24 12:52:27 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 13EC116A4CE for ; Fri, 24 Dec 2004 12:52:27 +0000 (GMT) Received: from web52701.mail.yahoo.com (web52701.mail.yahoo.com [206.190.39.152]) by mx1.FreeBSD.org (Postfix) with SMTP id 8C8B843D49 for ; Fri, 24 Dec 2004 12:52:26 +0000 (GMT) (envelope-from kamalpr@yahoo.com) Received: (qmail 79740 invoked by uid 60001); 24 Dec 2004 12:52:26 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=hjyt71vMeQWSf8px3yr/ORdwKStIh0S/A6+f92Fz9cxwsErt5BUjj2KaWYNkrLc1iX8Ed01wiApvkS6PSXVP7XRz4TQ4feG/eC0pUQCYgjXM5icoxDXLSG30/XytKuOa0iZwHtHOXDrANlsGqbZkkJO/MQMH7QIblP7UozLM2Y0= ; Message-ID: <20041224125226.79738.qmail@web52701.mail.yahoo.com> Received: from [203.195.199.244] by web52701.mail.yahoo.com via HTTP; Fri, 24 Dec 2004 04:52:25 PST Date: Fri, 24 Dec 2004 04:52:25 -0800 (PST) From: "Kamal R. Prasad" To: Jan Engelhardt In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: freebsd-hackers@freebsd.org Subject: Re: Kernel crash w/o reason X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: kamalp@acm.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Dec 2004 12:52:27 -0000 --- Jan Engelhardt wrote: > >> What should I use instead? A semaphore? > > >You shouldn't have unrelated kernel threads waiting > for a user > >process at all, so this sounds like a design > problem, regardless > >of which mutual exclusion primitive you use. (Bear > in mind that I > >haven't actually looked into what you're trying to > do.) In any > >case, you can always use mutexes to implement > whatever other > >synchronization mechanism you need. > > I wanted that the device can only be opened once, > and holding a mutex while it > is open seemed like a simple idea. (Since > mtx_trylock() will then fail -- easy > to implement.) An even more simpler idea would be to set a flag in the softc data structure on initialization, so as to avoid initializing again. regards -kamal > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org" > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com