Date: Tue, 17 Jul 2012 15:48:44 +0000 From: gmiller@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r239497 - in soc2012/gmiller/locking-head: . lib/libwitness Message-ID: <20120717154844.7FE911065675@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <sys/queue.h> +#include <errno.h> #include <pthread.h> #include <pthread_np.h> #include <stdlib.h> 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); +}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120717154844.7FE911065675>