Module Name: src Committed By: pooka Date: Tue May 7 16:40:31 UTC 2013
Modified Files: src/lib/librumpuser: rumpuser_pth_dummy.c Log Message: need the rw_downgrade/tryupgrade methods too To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/lib/librumpuser/rumpuser_pth_dummy.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/librumpuser/rumpuser_pth_dummy.c diff -u src/lib/librumpuser/rumpuser_pth_dummy.c:1.14 src/lib/librumpuser/rumpuser_pth_dummy.c:1.15 --- src/lib/librumpuser/rumpuser_pth_dummy.c:1.14 Tue May 7 15:37:05 2013 +++ src/lib/librumpuser/rumpuser_pth_dummy.c Tue May 7 16:40:31 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_pth_dummy.c,v 1.14 2013/05/07 15:37:05 pooka Exp $ */ +/* $NetBSD: rumpuser_pth_dummy.c,v 1.15 2013/05/07 16:40:31 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -29,7 +29,7 @@ #include <sys/cdefs.h> #if !defined(lint) -__RCSID("$NetBSD: rumpuser_pth_dummy.c,v 1.14 2013/05/07 15:37:05 pooka Exp $"); +__RCSID("$NetBSD: rumpuser_pth_dummy.c,v 1.15 2013/05/07 16:40:31 pooka Exp $"); #endif /* !lint */ #include <sys/time.h> @@ -209,6 +209,26 @@ rumpuser_rw_held(struct rumpuser_rw *rw, } } +void +rumpuser_rw_downgrade(struct rumpuser_rw *rw) +{ + + assert(rw->v == 1); + rw->v = -1; +} + +int +rumpuser_rw_tryupgrade(struct rumpuser_rw *rw) +{ + + if (rw->v == -1) { + rw->v = 1; + return 0; + } + + return EBUSY; +} + /*ARGSUSED*/ void rumpuser_cv_init(struct rumpuser_cv **cv)