From owner-svn-soc-all@FreeBSD.ORG Tue Jul 17 15:48:46 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id 7FE911065675 for ; Tue, 17 Jul 2012 15:48:44 +0000 (UTC) (envelope-from gmiller@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Tue, 17 Jul 2012 15:48:44 +0000 Date: Tue, 17 Jul 2012 15:48:44 +0000 From: gmiller@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120717154844.7FE911065675@hub.freebsd.org> Cc: Subject: socsvn commit: r239497 - in soc2012/gmiller/locking-head: . lib/libwitness X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2012 15:48:46 -0000 Author: gmiller Date: Tue Jul 17 15:48:43 2012 New Revision: 239497 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=239497 Log: r239510@FreeBSD-dev: root | 2012-07-14 07:22:18 -0500 Implement pthread_lockorder_set_np(). Modified: soc2012/gmiller/locking-head/ (props changed) soc2012/gmiller/locking-head/lib/libwitness/witness.h soc2012/gmiller/locking-head/lib/libwitness/wrappers.c Modified: soc2012/gmiller/locking-head/lib/libwitness/witness.h ============================================================================== --- soc2012/gmiller/locking-head/lib/libwitness/witness.h Tue Jul 17 14:36:40 2012 (r239496) +++ soc2012/gmiller/locking-head/lib/libwitness/witness.h Tue Jul 17 15:48:43 2012 (r239497) @@ -27,6 +27,7 @@ #include +#include #include #include #include Modified: soc2012/gmiller/locking-head/lib/libwitness/wrappers.c ============================================================================== --- soc2012/gmiller/locking-head/lib/libwitness/wrappers.c Tue Jul 17 14:36:40 2012 (r239496) +++ soc2012/gmiller/locking-head/lib/libwitness/wrappers.c Tue Jul 17 15:48:43 2012 (r239497) @@ -252,3 +252,13 @@ destroy_lock(spin); return (_pthread_spin_destroy(spin)); } + +int +pthread_lockorder_set_np(void *first, void *second) +{ + if (insert_lock(lookup_lock(first), lookup_lock(second)) < 0) { + return (EINVAL); + } + + return (0); +}