From owner-p4-projects@FreeBSD.ORG Mon Oct 3 18:33:49 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0C06316A421; Mon, 3 Oct 2005 18:33:49 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D69D316A41F for ; Mon, 3 Oct 2005 18:33:48 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A423843D45 for ; Mon, 3 Oct 2005 18:33:48 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j93IXmcM006758 for ; Mon, 3 Oct 2005 18:33:48 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j93IXmOj006755 for perforce@freebsd.org; Mon, 3 Oct 2005 18:33:48 GMT (envelope-from jhb@freebsd.org) Date: Mon, 3 Oct 2005 18:33:48 GMT Message-Id: <200510031833.j93IXmOj006755@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 84737 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2005 18:33:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=84737 Change 84737 by jhb@jhb_slimer on 2005/10/03 18:33:14 Pullup the refcount test from jhb_proc. Affected files ... .. //depot/projects/smpng/sys/modules/crash/crash.c#20 integrate Differences ... ==== //depot/projects/smpng/sys/modules/crash/crash.c#20 (text+ko) ==== @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -82,6 +83,28 @@ /* Events. */ +static void +refcount_test(void) +{ + int count; + + printf("Creating and bumping refcount\n"); + refcount_init(&count, 1); + refcount_acquire(&count); + printf("Dropping refcount first time: "); + if (refcount_release(&count)) + printf("true, (uh oh!)\n"); + else + printf("false\n"); + printf("Dropping refcount second time: "); + if (refcount_release(&count)) + printf("true\n"); + else + printf("false, (uh oh!)\n"); + printf("Ending count: %d\n", count); +} +CRASH_EVENT("refcount", refcount_test); + #ifdef WITNESS static void foo_then_bar(void)