From owner-freebsd-arch Fri Mar 21 12:19:35 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D223237B407 for ; Fri, 21 Mar 2003 12:19:32 -0800 (PST) Received: from mail.speakeasy.net (mail14.speakeasy.net [216.254.0.214]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4741A43FBF for ; Fri, 21 Mar 2003 12:19:32 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 27787 invoked from network); 21 Mar 2003 20:19:38 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail14.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 21 Mar 2003 20:19:38 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h2LKJTOv081491 for ; Fri, 21 Mar 2003 15:19:29 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Fri, 21 Mar 2003 15:19:29 -0500 (EST) From: John Baldwin To: arch@FreeBSD.org Subject: Convert process at_foo events to eventhandlers Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I'd like to convert the process at_fork, at_exec, and at_exit events to be regular eventhandlers instead. This way I get to leverage the locking of the existing eventhandlers w/o having to duplicate it in three other places. The patch to do this is at http://www.FreeBSD.org/~jhb/patches/proc_event.patch. Note that the old API (at_foo, rm_at_foo) has been removed as I can not easily implement the rm_at_foo functionality using eventhandlers since eventhandlers allow for multiple instances of a function in a list and use cookies instead of using the function pointer directly to remove events. There is precedent for this in that at_shutdown() also died when at_shutdown() was converted to an eventhandler. This patch also defines some generic eventhandler priorities so that users of eventhandlers don't always have to define new constants for priorities. Comments? -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message