From owner-freebsd-hackers Thu Jan 9 11:59:37 2003 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 2F19437B41E for ; Thu, 9 Jan 2003 11:59:32 -0800 (PST) Received: from prioris.mini.pw.edu.pl (prioris.mini.pw.edu.pl [194.29.178.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 92C0C43F13 for ; Thu, 9 Jan 2003 11:59:31 -0800 (PST) (envelope-from P.Dawidek@prioris.mini.pw.edu.pl) Received: from localhost (localhost.mini.pw.edu.pl [127.0.0.1]) by prioris.mini.pw.edu.pl (Postfix) with ESMTP id 16CC37D304; Thu, 9 Jan 2003 20:59:30 +0100 (CET) Received: by prioris.mini.pw.edu.pl (Postfix, from userid 1091) id 5804A7D307; Thu, 9 Jan 2003 20:59:25 +0100 (CET) Date: Thu, 9 Jan 2003 20:59:25 +0100 From: Pawel Jakub Dawidek To: Julian Elischer Cc: freebsd-hackers@freebsd.org Subject: Re: Exceptions via setjmp/longjmp in kernel. Message-ID: <20030109195925.GD51455@prioris.mini.pw.edu.pl> References: <20030109143059.GC47263@prioris.mini.pw.edu.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-PGP-Key-URL: http://garage.freebsd.pl/jules.pgp X-OS: FreeBSD 4.7-STABLE i386 X-Virus-Scanned: by AMaViS (prioris) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Jan 09, 2003 at 10:51:13AM -0800, Julian Elischer wrote: +> how do you ensure that the thread doesn't own any locks when it does the +> longjmp? Hmm, hard to explain. I got my own infrastructure for this and every locks that are done I got in my-threads, so I just have to check those thread when setjmp() returns value != 0 and release them. I got also my own functions for locking/unlocking data based on tsleep()/wakeup_one() functions. For now this works only on 4.x, but I want to be prepare for 5.x (but I don't understand mutexes handling for now). Also... I got setjmp() only in one place and when I'm returning with longjmp() I need to just unlock everything that was locked between setjmp() and longjmp() and this is easy, because every lock is stored in my-thread structure. -- Pawel Jakub Dawidek UNIX Systems Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message