From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 11 13:03:35 2007 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C1A616A418 for ; Sat, 11 Aug 2007 13:03:35 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 16D7213C4A3 for ; Sat, 11 Aug 2007 13:03:34 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 4FFF78C0E82 for ; Sat, 11 Aug 2007 14:46:14 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z0sDsy274Uak for ; Sat, 11 Aug 2007 14:46:13 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 538888C0E42 for ; Sat, 11 Aug 2007 14:46:13 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.13.8/8.13.8/Submit) id l7BCkDY7021799 for hackers@freebsd.org; Sat, 11 Aug 2007 14:46:13 +0200 (CEST) (envelope-from rdivacky) Date: Sat, 11 Aug 2007 14:46:12 +0200 From: Roman Divacky To: hackers@freebsd.org Message-ID: <20070811124612.GA21695@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: strange KASSERT in _sleep() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2007 13:03:35 -0000 hi tsleep() maps to _sleep() with lock = NULL, the _sleep() contains this: KASSERT(timo != 0 || mtx_owned(&Giant) || lock != NULL || ident == &lbolt, ("sleeping without a lock")); which simplifies for tsleep(foo, ...) where foo != lbolt to "timo != 0 || mtx_owned(&Giant)" why do I have to hold Giant or have timo != 0 when calling tsleep? thnx for explanation roman