svn commit: r324425 - head/sys/cddl/compat/opensolaris/sys
Andriy Gapon
avg at FreeBSD.org
Mon Oct 9 07:44:11 UTC 2017
Author: avg
Date: Mon Oct 9 07:44:09 2017
New Revision: 324425
URL: https://svnweb.freebsd.org/changeset/base/324425
Log:
illumos mutex_init: use SX_NEW instead of bzero
There should be no functional change, but SX_NEW seems to be more
idiomatic to the use-case.
MFC after: 2 weeks
X-MFC note: stable/11 only
Modified:
head/sys/cddl/compat/opensolaris/sys/mutex.h
Modified: head/sys/cddl/compat/opensolaris/sys/mutex.h
==============================================================================
--- head/sys/cddl/compat/opensolaris/sys/mutex.h Mon Oct 9 05:16:34 2017 (r324424)
+++ head/sys/cddl/compat/opensolaris/sys/mutex.h Mon Oct 9 07:44:09 2017 (r324425)
@@ -47,9 +47,9 @@ typedef enum {
typedef struct sx kmutex_t;
#ifndef OPENSOLARIS_WITNESS
-#define MUTEX_FLAGS (SX_DUPOK | SX_NOWITNESS)
+#define MUTEX_FLAGS (SX_DUPOK | SX_NEW | SX_NOWITNESS)
#else
-#define MUTEX_FLAGS (SX_DUPOK)
+#define MUTEX_FLAGS (SX_DUPOK | SX_NEW)
#endif
#define mutex_init(lock, desc, type, arg) do { \
@@ -57,7 +57,6 @@ typedef struct sx kmutex_t;
ASSERT((type) == 0 || (type) == MUTEX_DEFAULT); \
KASSERT(((lock)->lock_object.lo_flags & LO_ALLMASK) != \
LO_EXPECTED, ("lock %s already initialized", #lock)); \
- bzero((lock), sizeof(struct sx)); \
for (_name = #lock; *_name != '\0'; _name++) { \
if (*_name >= 'a' && *_name <= 'z') \
break; \
More information about the svn-src-all
mailing list