Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Jan 2010 23:09:34 +0000 (UTC)
From:      Kip Macy <kmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r201623 - user/kmacy/releng_8_rump/lib/libunet
Message-ID:  <201001052309.o05N9Yo6041394@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmacy
Date: Tue Jan  5 23:09:34 2010
New Revision: 201623
URL: http://svn.freebsd.org/changeset/base/201623

Log:
  shim sx locks

Modified:
  user/kmacy/releng_8_rump/lib/libunet/unet_lock.c

Modified: user/kmacy/releng_8_rump/lib/libunet/unet_lock.c
==============================================================================
--- user/kmacy/releng_8_rump/lib/libunet/unet_lock.c	Tue Jan  5 23:03:59 2010	(r201622)
+++ user/kmacy/releng_8_rump/lib/libunet/unet_lock.c	Tue Jan  5 23:09:34 2010	(r201623)
@@ -277,19 +277,29 @@ _rm_runlock(struct rmlock *rm,  struct r
 }
 
 
+struct lock_class lock_class_sx = {
+	.lc_name = "sx",
+	.lc_flags = LC_SLEEPLOCK | LC_SLEEPABLE | LC_RECURSABLE | LC_UPGRADABLE,
+#ifdef DDB
+	.lc_ddb_show = db_show_sx,
+#endif
+#ifdef KDTRACE_HOOKS
+	.lc_owner = owner_sx,
+#endif
+};
 
 void
 sx_init_flags(struct sx *sx, const char *description, int opts)
 {
 
-	panic("");
+	rw_init_flags((struct rwlock *)sx, description, opts);
 }
 
 void
 sx_destroy(struct sx *sx)
 {
 
-	panic("");
+	rw_destroy((struct rwlock *)sx);
 }
 
 int
@@ -297,7 +307,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t 
     const char *file, int line)
 {
 	
-	panic("");
+	_rw_wlock((struct rwlock *)sx, file, line);
 	return (0);
 }
 
@@ -305,7 +315,7 @@ int
 _sx_slock_hard(struct sx *sx, int opts, const char *file, int line)
 {
 	
-	panic("");
+	_rw_rlock((struct rwlock *)sx, file, line);
 	return (0);
 }
 
@@ -314,21 +324,20 @@ _sx_xunlock_hard(struct sx *sx, uintptr_
     line)
 {
 	
-	panic("");
+	_rw_wunlock((struct rwlock *)sx, file, line);
 }
 
 void
 _sx_sunlock_hard(struct sx *sx, const char *file, int line)
 {
 	
-	panic("");
+	_rw_runlock((struct rwlock *)sx, file, line);
 }
 
 int
 _sx_try_xlock(struct sx *sx, const char *file, int line)
 {
-	
-	panic("");
-	return (0);
+
+	return (_rw_try_wlock((struct rwlock *)sx, file, line));
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001052309.o05N9Yo6041394>