Jelajahi Sumber

Ticket #15 - Get rid of rwlock.h/rwlock.c and just use slapi_rwlock instead

https://fedorahosted.org/389/ticket/15
Resolves: Ticket #15
Bug Description: Get rid of rwlock.h/rwlock.c and just use slapi_rwlock instead
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: Get rid of slapd rwlock rwl API and use slapi_rwlock instead.
the lib/base/rwlock code was not used at all, so get rid of it
Platforms tested: RHEL6 x86_64
Flag Day: Yes - header file and autoconf file changes
Doc impact: no
Rich Megginson 14 tahun lalu
induk
melakukan
584dc80727

+ 0 - 2
Makefile.am

@@ -585,7 +585,6 @@ libns_dshttpd_la_SOURCES = lib/libaccess/access_plhash.cpp \
 	lib/base/nscperror.c \
 	lib/base/plist.cpp \
 	lib/base/pool.cpp \
-	lib/base/rwlock.cpp \
 	lib/base/shexp.cpp \
 	lib/base/system.cpp \
 	lib/base/systhr.cpp \
@@ -671,7 +670,6 @@ libslapd_la_SOURCES = ldap/servers/slapd/add.c \
 	ldap/servers/slapd/regex.c \
 	ldap/servers/slapd/resourcelimit.c \
 	ldap/servers/slapd/result.c \
-	ldap/servers/slapd/rwlock.c \
 	ldap/servers/slapd/sasl_map.c \
 	ldap/servers/slapd/schema.c \
 	ldap/servers/slapd/schemaparse.c \

+ 5 - 40
Makefile.in

@@ -426,7 +426,6 @@ am_libns_dshttpd_la_OBJECTS =  \
 	lib/base/libns_dshttpd_la-nscperror.lo \
 	lib/base/libns_dshttpd_la-plist.lo \
 	lib/base/libns_dshttpd_la-pool.lo \
-	lib/base/libns_dshttpd_la-rwlock.lo \
 	lib/base/libns_dshttpd_la-shexp.lo \
 	lib/base/libns_dshttpd_la-system.lo \
 	lib/base/libns_dshttpd_la-systhr.lo \
@@ -636,9 +635,8 @@ am__libslapd_la_SOURCES_DIST = ldap/servers/slapd/add.c \
 	ldap/servers/slapd/pw.c ldap/servers/slapd/pw_retry.c \
 	ldap/servers/slapd/rdn.c ldap/servers/slapd/referral.c \
 	ldap/servers/slapd/regex.c ldap/servers/slapd/resourcelimit.c \
-	ldap/servers/slapd/result.c ldap/servers/slapd/rwlock.c \
-	ldap/servers/slapd/sasl_map.c ldap/servers/slapd/schema.c \
-	ldap/servers/slapd/schemaparse.c \
+	ldap/servers/slapd/result.c ldap/servers/slapd/sasl_map.c \
+	ldap/servers/slapd/schema.c ldap/servers/slapd/schemaparse.c \
 	ldap/servers/slapd/security_wrappers.c \
 	ldap/servers/slapd/slapd_plhash.c \
 	ldap/servers/slapd/slapi_counter.c \
@@ -725,7 +723,6 @@ am_libslapd_la_OBJECTS = ldap/servers/slapd/libslapd_la-add.lo \
 	ldap/servers/slapd/libslapd_la-regex.lo \
 	ldap/servers/slapd/libslapd_la-resourcelimit.lo \
 	ldap/servers/slapd/libslapd_la-result.lo \
-	ldap/servers/slapd/libslapd_la-rwlock.lo \
 	ldap/servers/slapd/libslapd_la-sasl_map.lo \
 	ldap/servers/slapd/libslapd_la-schema.lo \
 	ldap/servers/slapd/libslapd_la-schemaparse.lo \
@@ -1091,7 +1088,6 @@ CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -1124,7 +1120,6 @@ LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NETSNMP_CONFIG = @NETSNMP_CONFIG@
 NM = @NM@
@@ -1139,12 +1134,9 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
@@ -1156,7 +1148,6 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -1223,6 +1214,7 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mibdir = $(datadir)@mibdir@
 mkdir_p = @mkdir_p@
@@ -1788,7 +1780,6 @@ libns_dshttpd_la_SOURCES = lib/libaccess/access_plhash.cpp \
 	lib/base/nscperror.c \
 	lib/base/plist.cpp \
 	lib/base/pool.cpp \
-	lib/base/rwlock.cpp \
 	lib/base/shexp.cpp \
 	lib/base/system.cpp \
 	lib/base/systhr.cpp \
@@ -1844,9 +1835,8 @@ libslapd_la_SOURCES = ldap/servers/slapd/add.c \
 	ldap/servers/slapd/pw.c ldap/servers/slapd/pw_retry.c \
 	ldap/servers/slapd/rdn.c ldap/servers/slapd/referral.c \
 	ldap/servers/slapd/regex.c ldap/servers/slapd/resourcelimit.c \
-	ldap/servers/slapd/result.c ldap/servers/slapd/rwlock.c \
-	ldap/servers/slapd/sasl_map.c ldap/servers/slapd/schema.c \
-	ldap/servers/slapd/schemaparse.c \
+	ldap/servers/slapd/result.c ldap/servers/slapd/sasl_map.c \
+	ldap/servers/slapd/schema.c ldap/servers/slapd/schemaparse.c \
 	ldap/servers/slapd/security_wrappers.c \
 	ldap/servers/slapd/slapd_plhash.c \
 	ldap/servers/slapd/slapi_counter.c \
@@ -3428,8 +3418,6 @@ lib/base/libns_dshttpd_la-plist.lo: lib/base/$(am__dirstamp) \
 	lib/base/$(DEPDIR)/$(am__dirstamp)
 lib/base/libns_dshttpd_la-pool.lo: lib/base/$(am__dirstamp) \
 	lib/base/$(DEPDIR)/$(am__dirstamp)
-lib/base/libns_dshttpd_la-rwlock.lo: lib/base/$(am__dirstamp) \
-	lib/base/$(DEPDIR)/$(am__dirstamp)
 lib/base/libns_dshttpd_la-shexp.lo: lib/base/$(am__dirstamp) \
 	lib/base/$(DEPDIR)/$(am__dirstamp)
 lib/base/libns_dshttpd_la-system.lo: lib/base/$(am__dirstamp) \
@@ -4022,9 +4010,6 @@ ldap/servers/slapd/libslapd_la-resourcelimit.lo:  \
 ldap/servers/slapd/libslapd_la-result.lo:  \
 	ldap/servers/slapd/$(am__dirstamp) \
 	ldap/servers/slapd/$(DEPDIR)/$(am__dirstamp)
-ldap/servers/slapd/libslapd_la-rwlock.lo:  \
-	ldap/servers/slapd/$(am__dirstamp) \
-	ldap/servers/slapd/$(DEPDIR)/$(am__dirstamp)
 ldap/servers/slapd/libslapd_la-sasl_map.lo:  \
 	ldap/servers/slapd/$(am__dirstamp) \
 	ldap/servers/slapd/$(DEPDIR)/$(am__dirstamp)
@@ -5349,8 +5334,6 @@ mostlyclean-compile:
 	-rm -f ldap/servers/slapd/libslapd_la-resourcelimit.lo
 	-rm -f ldap/servers/slapd/libslapd_la-result.$(OBJEXT)
 	-rm -f ldap/servers/slapd/libslapd_la-result.lo
-	-rm -f ldap/servers/slapd/libslapd_la-rwlock.$(OBJEXT)
-	-rm -f ldap/servers/slapd/libslapd_la-rwlock.lo
 	-rm -f ldap/servers/slapd/libslapd_la-sasl_map.$(OBJEXT)
 	-rm -f ldap/servers/slapd/libslapd_la-sasl_map.lo
 	-rm -f ldap/servers/slapd/libslapd_la-schema.$(OBJEXT)
@@ -5480,8 +5463,6 @@ mostlyclean-compile:
 	-rm -f lib/base/libns_dshttpd_la-plist.lo
 	-rm -f lib/base/libns_dshttpd_la-pool.$(OBJEXT)
 	-rm -f lib/base/libns_dshttpd_la-pool.lo
-	-rm -f lib/base/libns_dshttpd_la-rwlock.$(OBJEXT)
-	-rm -f lib/base/libns_dshttpd_la-rwlock.lo
 	-rm -f lib/base/libns_dshttpd_la-shexp.$(OBJEXT)
 	-rm -f lib/base/libns_dshttpd_la-shexp.lo
 	-rm -f lib/base/libns_dshttpd_la-system.$(OBJEXT)
@@ -5828,7 +5809,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-regex.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-resourcelimit.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-result.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-rwlock.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-sasl_map.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-schema.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-schemaparse.Plo@am__quote@
@@ -5984,7 +5964,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@lib/base/$(DEPDIR)/libns_dshttpd_la-nscperror.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@lib/base/$(DEPDIR)/libns_dshttpd_la-plist.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@lib/base/$(DEPDIR)/libns_dshttpd_la-pool.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@lib/base/$(DEPDIR)/libns_dshttpd_la-rwlock.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@lib/base/$(DEPDIR)/libns_dshttpd_la-shexp.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@lib/base/$(DEPDIR)/libns_dshttpd_la-system.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@lib/base/$(DEPDIR)/libns_dshttpd_la-systhr.Plo@am__quote@
@@ -8269,13 +8248,6 @@ ldap/servers/slapd/libslapd_la-result.lo: ldap/servers/slapd/result.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libslapd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/slapd/libslapd_la-result.lo `test -f 'ldap/servers/slapd/result.c' || echo '$(srcdir)/'`ldap/servers/slapd/result.c
 
-ldap/servers/slapd/libslapd_la-rwlock.lo: ldap/servers/slapd/rwlock.c
-@am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libslapd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/slapd/libslapd_la-rwlock.lo -MD -MP -MF ldap/servers/slapd/$(DEPDIR)/libslapd_la-rwlock.Tpo -c -o ldap/servers/slapd/libslapd_la-rwlock.lo `test -f 'ldap/servers/slapd/rwlock.c' || echo '$(srcdir)/'`ldap/servers/slapd/rwlock.c
-@am__fastdepCC_TRUE@	$(am__mv) ldap/servers/slapd/$(DEPDIR)/libslapd_la-rwlock.Tpo ldap/servers/slapd/$(DEPDIR)/libslapd_la-rwlock.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ldap/servers/slapd/rwlock.c' object='ldap/servers/slapd/libslapd_la-rwlock.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libslapd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/slapd/libslapd_la-rwlock.lo `test -f 'ldap/servers/slapd/rwlock.c' || echo '$(srcdir)/'`ldap/servers/slapd/rwlock.c
-
 ldap/servers/slapd/libslapd_la-sasl_map.lo: ldap/servers/slapd/sasl_map.c
 @am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libslapd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/slapd/libslapd_la-sasl_map.lo -MD -MP -MF ldap/servers/slapd/$(DEPDIR)/libslapd_la-sasl_map.Tpo -c -o ldap/servers/slapd/libslapd_la-sasl_map.lo `test -f 'ldap/servers/slapd/sasl_map.c' || echo '$(srcdir)/'`ldap/servers/slapd/sasl_map.c
 @am__fastdepCC_TRUE@	$(am__mv) ldap/servers/slapd/$(DEPDIR)/libslapd_la-sasl_map.Tpo ldap/servers/slapd/$(DEPDIR)/libslapd_la-sasl_map.Plo
@@ -9735,13 +9707,6 @@ lib/base/libns_dshttpd_la-pool.lo: lib/base/pool.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libns_dshttpd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lib/base/libns_dshttpd_la-pool.lo `test -f 'lib/base/pool.cpp' || echo '$(srcdir)/'`lib/base/pool.cpp
 
-lib/base/libns_dshttpd_la-rwlock.lo: lib/base/rwlock.cpp
-@am__fastdepCXX_TRUE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libns_dshttpd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lib/base/libns_dshttpd_la-rwlock.lo -MD -MP -MF lib/base/$(DEPDIR)/libns_dshttpd_la-rwlock.Tpo -c -o lib/base/libns_dshttpd_la-rwlock.lo `test -f 'lib/base/rwlock.cpp' || echo '$(srcdir)/'`lib/base/rwlock.cpp
-@am__fastdepCXX_TRUE@	$(am__mv) lib/base/$(DEPDIR)/libns_dshttpd_la-rwlock.Tpo lib/base/$(DEPDIR)/libns_dshttpd_la-rwlock.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='lib/base/rwlock.cpp' object='lib/base/libns_dshttpd_la-rwlock.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libns_dshttpd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lib/base/libns_dshttpd_la-rwlock.lo `test -f 'lib/base/rwlock.cpp' || echo '$(srcdir)/'`lib/base/rwlock.cpp
-
 lib/base/libns_dshttpd_la-shexp.lo: lib/base/shexp.cpp
 @am__fastdepCXX_TRUE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libns_dshttpd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lib/base/libns_dshttpd_la-shexp.lo -MD -MP -MF lib/base/$(DEPDIR)/libns_dshttpd_la-shexp.Tpo -c -o lib/base/libns_dshttpd_la-shexp.lo `test -f 'lib/base/shexp.cpp' || echo '$(srcdir)/'`lib/base/shexp.cpp
 @am__fastdepCXX_TRUE@	$(am__mv) lib/base/$(DEPDIR)/libns_dshttpd_la-shexp.Tpo lib/base/$(DEPDIR)/libns_dshttpd_la-shexp.Plo

+ 19 - 21
aclocal.m4

@@ -13,14 +13,13 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
 
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
-# serial 1 (pkg-config-0.24)
 # 
 # Copyright © 2004 Scott James Remnant <[email protected]>.
 #
@@ -48,10 +47,7 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
-AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
-AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
-AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
-
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
 fi
@@ -64,6 +60,7 @@ if test -n "$PKG_CONFIG"; then
 		AC_MSG_RESULT([no])
 		PKG_CONFIG=""
 	fi
+		
 fi[]dnl
 ])# PKG_PROG_PKG_CONFIG
 
@@ -72,20 +69,21 @@ fi[]dnl
 # Check to see whether a particular set of modules exists.  Similar
 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
 #
-# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-# only at the first occurence in configure.ac, so if the first place
-# it's called might be skipped (such as if it is within an "if", you
-# have to call PKG_CHECK_EXISTS manually
+#
+# Similar to PKG_CHECK_MODULES, make sure that the first instance of
+# this or PKG_CHECK_MODULES is called, or make sure to call
+# PKG_CHECK_EXISTS manually
 # --------------------------------------------------------------
 AC_DEFUN([PKG_CHECK_EXISTS],
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 if test -n "$PKG_CONFIG" && \
     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
-  m4_default([$2], [:])
+  m4_ifval([$2], [$2], [:])
 m4_ifvaln([$3], [else
   $3])dnl
 fi])
 
+
 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
 # ---------------------------------------------
 m4_define([_PKG_CONFIG],
@@ -138,7 +136,6 @@ and $1[]_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details.])
 
 if test $pkg_failed = yes; then
-   	AC_MSG_RESULT([no])
         _PKG_SHORT_ERRORS_SUPPORTED
         if test $_pkg_short_errors_supported = yes; then
 	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
@@ -148,7 +145,7 @@ if test $pkg_failed = yes; then
 	# Put the nasty error message in config.log where it belongs
 	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
-	m4_default([$4], [AC_MSG_ERROR(
+	ifelse([$4], , [AC_MSG_ERROR(dnl
 [Package requirements ($2) were not met:
 
 $$1_PKG_ERRORS
@@ -156,24 +153,25 @@ $$1_PKG_ERRORS
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
 installed software in a non-standard prefix.
 
-_PKG_TEXT])
-        ])
+_PKG_TEXT
+])],
+		[AC_MSG_RESULT([no])
+                $4])
 elif test $pkg_failed = untried; then
-     	AC_MSG_RESULT([no])
-	m4_default([$4], [AC_MSG_FAILURE(
+	ifelse([$4], , [AC_MSG_FAILURE(dnl
 [The pkg-config script could not be found or is too old.  Make sure it
 is in your PATH or set the PKG_CONFIG environment variable to the full
 path to pkg-config.
 
 _PKG_TEXT
 
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
-        ])
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
+		[$4])
 else
 	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
 	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
         AC_MSG_RESULT([yes])
-	$3
+	ifelse([$3], , :, [$3])
 fi[]dnl
 ])# PKG_CHECK_MODULES
 

+ 0 - 6
config.h.in

@@ -247,9 +247,6 @@
    */
 #undef HAVE_SYS_NDIR_H
 
-/* Define to 1 if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
 /* Define to 1 if you have the <sys/socket.h> header file. */
 #undef HAVE_SYS_SOCKET_H
 
@@ -366,9 +363,6 @@
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 

File diff ditekan karena terlalu besar
+ 580 - 406
configure


+ 0 - 91
include/base/rwlock.h

@@ -1,91 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * This Program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation; version 2 of the License.
- * 
- * This Program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License along with
- * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA.
- * 
- * In addition, as a special exception, Red Hat, Inc. gives You the additional
- * right to link the code of this Program with code not covered under the GNU
- * General Public License ("Non-GPL Code") and to distribute linked combinations
- * including the two, subject to the limitations in this paragraph. Non-GPL Code
- * permitted under this exception must only link to the code of this Program
- * through those well defined interfaces identified in the file named EXCEPTION
- * found in the source code files (the "Approved Interfaces"). The files of
- * Non-GPL Code may instantiate templates or use macros or inline functions from
- * the Approved Interfaces without causing the resulting work to be covered by
- * the GNU General Public License. Only Red Hat, Inc. may make changes or
- * additions to the list of Approved Interfaces. You must obey the GNU General
- * Public License in all respects for all of the Program code and other code used
- * in conjunction with the Program except the Non-GPL Code covered by this
- * exception. If you modify this file, you may extend this exception to your
- * version of the file, but you are not obligated to do so. If you do not wish to
- * provide this exception without modification, you must delete this exception
- * statement from your version and license this file solely under the GPL without
- * exception. 
- * 
- * 
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-/*
- * rwlock.h: Shared/Exclusive lock abstraction. 
- * 
- * Sanjay Krishnamurthi
- */
-#ifndef _BASE_RWLOCK_H_
-#define _BASE_RWLOCK_H_
-
-#include "netsite.h"
-#include "crit.h"
-
-NSPR_BEGIN_EXTERN_C
-
-typedef void* RWLOCK;
-
-/*
- * rwlock_Init()
- *  creates and returns a new readwrite lock variable. 
- */
-NSAPI_PUBLIC RWLOCK rwlock_Init(void);
-
-/*
- * rwlock_ReadLock()
- */
-NSAPI_PUBLIC void rwlock_ReadLock(RWLOCK lock);
-
-/*
- * rwlock_WriteLock()
- */
-NSAPI_PUBLIC void rwlock_WriteLock(RWLOCK lock);
-
-/*
- * rwlock_Unlock()
- */
-NSAPI_PUBLIC void rwlock_Unlock(RWLOCK lock);
-
-/*
- * rwlock_DemoteLock()
- */
-NSAPI_PUBLIC void rwlock_DemoteLock(RWLOCK lock);
-
-/*
- * rwlock_terminate removes a previously allocated RWLOCK variable.
- */
-NSAPI_PUBLIC void rwlock_Terminate(RWLOCK lock);
-
-NSPR_END_EXTERN_C
-
-#endif /* _BASE_RWLOCK_H_ */

+ 0 - 1
ldap/servers/plugins/acl/acl.h

@@ -85,7 +85,6 @@
 #include	"slap.h"
 #include	"slapi-private.h"
 #include	"portable.h"
-#include 	"prrwlock.h"
 #include	"avl.h"
 
 #include	"cert.h"

+ 0 - 1
ldap/servers/slapd/generation.c

@@ -44,7 +44,6 @@
 #include <stdio.h>
 #include <time.h>
 
-#include "rwlock.h"
 #include "slap.h"
 
 /*

+ 1 - 1
ldap/servers/slapd/libglobs.c

@@ -888,7 +888,7 @@ FrontendConfig_init () {
   slapdFrontendConfig_t *cfg = getFrontendConfig();
 
   /* initialize the read/write configuration lock */
-  if ( (cfg->cfg_rwlock = rwl_new()) == NULL ) {
+  if ( (cfg->cfg_rwlock = slapi_new_rwlock()) == NULL ) {
 	LDAPDebug ( LDAP_DEBUG_ANY, 
 				"FrontendConfig_init: failed to initialize cfg_rwlock. Exiting now.",
 				0,0,0 );

+ 2 - 2
ldap/servers/slapd/log.c

@@ -325,7 +325,7 @@ void g_log_init(int log_enabled)
 	loginfo.log_error_fdes = NULL;
 	loginfo.log_numof_error_logs = 1;
 	loginfo.log_error_logchain = NULL;
-	if ((loginfo.log_error_rwlock =rwl_new())== NULL ) {
+	if ((loginfo.log_error_rwlock =slapi_new_rwlock())== NULL ) {
 		exit (-1);
 	}
 
@@ -352,7 +352,7 @@ void g_log_init(int log_enabled)
 	loginfo.log_numof_audit_logs = 1;
 	loginfo.log_audit_fdes = NULL;
 	loginfo.log_audit_logchain = NULL;
-	if ((loginfo.log_audit_rwlock =rwl_new())== NULL ) {
+	if ((loginfo.log_audit_rwlock =slapi_new_rwlock())== NULL ) {
 		exit (-1);
 	}
 }

+ 10 - 10
ldap/servers/slapd/log.h

@@ -183,7 +183,7 @@ struct logging_opts {
 	time_t		log_error_ctime;	/* log creation time */
 	LogFileInfo	*log_error_logchain;	/* all the logs info */
 	char		*log_errorinfo_file;	/* error log rotation info file */
-	rwl		*log_error_rwlock;	/* lock on error*/
+	Slapi_RWLock		*log_error_rwlock;	/* lock on error*/
 
 	/* These are audit log specific */
 	int		log_audit_state;
@@ -209,7 +209,7 @@ struct logging_opts {
 	time_t		log_audit_ctime;	/* log creation time */
 	LogFileInfo	*log_audit_logchain;	/* all the logs info */
 	char		*log_auditinfo_file;	/* audit log rotation info file */
-	rwl		*log_audit_rwlock;	/* lock on audit*/
+	Slapi_RWLock		*log_audit_rwlock;	/* lock on audit*/
 
 };
 
@@ -222,13 +222,13 @@ struct logging_opts {
 #define LOG_ACCESS_LOCK_WRITE()   PR_Lock(loginfo.log_access_buffer->lock)
 #define LOG_ACCESS_UNLOCK_WRITE() PR_Unlock(loginfo.log_access_buffer->lock)
 
-#define LOG_ERROR_LOCK_READ()    loginfo.log_error_rwlock->rwl_acquire_read_lock(loginfo.log_error_rwlock)
-#define LOG_ERROR_UNLOCK_READ()  loginfo.log_error_rwlock->rwl_relinquish_read_lock(loginfo.log_error_rwlock)
-#define LOG_ERROR_LOCK_WRITE()    loginfo.log_error_rwlock->rwl_acquire_write_lock(loginfo.log_error_rwlock)
-#define LOG_ERROR_UNLOCK_WRITE()  loginfo.log_error_rwlock->rwl_relinquish_write_lock(loginfo.log_error_rwlock)
+#define LOG_ERROR_LOCK_READ()    slapi_rwlock_rdlock(loginfo.log_error_rwlock)
+#define LOG_ERROR_UNLOCK_READ()  slapi_rwlock_unlock(loginfo.log_error_rwlock)
+#define LOG_ERROR_LOCK_WRITE()   slapi_rwlock_wrlock(loginfo.log_error_rwlock)
+#define LOG_ERROR_UNLOCK_WRITE() slapi_rwlock_unlock(loginfo.log_error_rwlock)
 
-#define LOG_AUDIT_LOCK_READ()    loginfo.log_audit_rwlock->rwl_acquire_read_lock(loginfo.log_audit_rwlock)
-#define LOG_AUDIT_UNLOCK_READ()  loginfo.log_audit_rwlock->rwl_relinquish_read_lock(loginfo.log_audit_rwlock)
-#define LOG_AUDIT_LOCK_WRITE()    loginfo.log_audit_rwlock->rwl_acquire_write_lock(loginfo.log_audit_rwlock)
-#define LOG_AUDIT_UNLOCK_WRITE()  loginfo.log_audit_rwlock->rwl_relinquish_write_lock(loginfo.log_audit_rwlock)
+#define LOG_AUDIT_LOCK_READ()    slapi_rwlock_rdlock(loginfo.log_audit_rwlock)
+#define LOG_AUDIT_UNLOCK_READ()  slapi_rwlock_unlock(loginfo.log_audit_rwlock)
+#define LOG_AUDIT_LOCK_WRITE()   slapi_rwlock_wrlock(loginfo.log_audit_rwlock)
+#define LOG_AUDIT_UNLOCK_WRITE() slapi_rwlock_unlock(loginfo.log_audit_rwlock)
 

+ 6 - 6
ldap/servers/slapd/psearch.c

@@ -86,7 +86,7 @@ typedef struct _psearch {
  * A list of outstanding persistent searches.
  */
 typedef struct _psearch_list {
-    rwl		*pl_rwlock;	/* R/W lock struct to serialize access */
+    Slapi_RWLock		*pl_rwlock;	/* R/W lock struct to serialize access */
     PSearch	*pl_head;	/* Head of list */
     PRLock	*pl_cvarlock;	/* Lock for cvar */
     PRCondVar	*pl_cvar;	/* ps threads sleep on this */
@@ -95,10 +95,10 @@ typedef struct _psearch_list {
 /*
  * Convenience macros for locking the list of persistent searches
  */
-#define PSL_LOCK_READ()    psearch_list->pl_rwlock->rwl_acquire_read_lock( psearch_list->pl_rwlock)
-#define PSL_UNLOCK_READ()  psearch_list->pl_rwlock->rwl_relinquish_read_lock( psearch_list->pl_rwlock )
-#define PSL_LOCK_WRITE()   psearch_list->pl_rwlock->rwl_acquire_write_lock( psearch_list->pl_rwlock )
-#define PSL_UNLOCK_WRITE() psearch_list->pl_rwlock->rwl_relinquish_write_lock( psearch_list->pl_rwlock )
+#define PSL_LOCK_READ()    slapi_rwlock_rdlock(psearch_list->pl_rwlock)
+#define PSL_UNLOCK_READ()  slapi_rwlock_unlock(psearch_list->pl_rwlock)
+#define PSL_LOCK_WRITE()   slapi_rwlock_wrlock(psearch_list->pl_rwlock)
+#define PSL_UNLOCK_WRITE() slapi_rwlock_unlock(psearch_list->pl_rwlock)
     
 
 /*
@@ -130,7 +130,7 @@ ps_init_psearch_system()
 {
     if ( !PS_IS_INITIALIZED()) {
 	psearch_list = (PSearch_List *) slapi_ch_calloc( 1, sizeof( PSearch_List ));
-	if (( psearch_list->pl_rwlock = rwl_new()) == NULL ) {
+	if (( psearch_list->pl_rwlock = slapi_new_rwlock()) == NULL ) {
 	    LDAPDebug( LDAP_DEBUG_ANY, "init_psearch_list: cannot initialize lock structure. "
 		    "The server is terminating.\n", 0, 0, 0 );
 	    exit( -1 );

+ 2 - 2
ldap/servers/slapd/referral.c

@@ -72,7 +72,7 @@ g_get_global_referrals(void)
     if (global_referrals.ra_rwlock == NULL)
 	{
         /* Make a new lock */
-        global_referrals.ra_rwlock = rwl_new();
+        global_referrals.ra_rwlock = slapi_new_rwlock();
       
         if (global_referrals.ra_rwlock == NULL) {
             LDAPDebug( LDAP_DEBUG_ANY,
@@ -139,7 +139,7 @@ referrals_free (void)
 
   GR_UNLOCK_WRITE();
 
-  rwl_free( &grefs->ra_rwlock );
+  slapi_destroy_rwlock( grefs->ra_rwlock );
 }
 
 /*

+ 0 - 257
ldap/servers/slapd/rwlock.c

@@ -1,257 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * This Program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation; version 2 of the License.
- * 
- * This Program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License along with
- * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA.
- * 
- * In addition, as a special exception, Red Hat, Inc. gives You the additional
- * right to link the code of this Program with code not covered under the GNU
- * General Public License ("Non-GPL Code") and to distribute linked combinations
- * including the two, subject to the limitations in this paragraph. Non-GPL Code
- * permitted under this exception must only link to the code of this Program
- * through those well defined interfaces identified in the file named EXCEPTION
- * found in the source code files (the "Approved Interfaces"). The files of
- * Non-GPL Code may instantiate templates or use macros or inline functions from
- * the Approved Interfaces without causing the resulting work to be covered by
- * the GNU General Public License. Only Red Hat, Inc. may make changes or
- * additions to the list of Approved Interfaces. You must obey the GNU General
- * Public License in all respects for all of the Program code and other code used
- * in conjunction with the Program except the Non-GPL Code covered by this
- * exception. If you modify this file, you may extend this exception to your
- * version of the file, but you are not obligated to do so. If you do not wish to
- * provide this exception without modification, you must delete this exception
- * statement from your version and license this file solely under the GPL without
- * exception. 
- * 
- * 
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-/*
- * rwlock.c - generic multiple reader, single-writer locking routines.
- *
- * The general idea is:
- *
- *  If you have a data structure which you'd like to allow multiple threads
- *  to read, but only one thread at a time to write, you include in your
- *  data structure a pointer to an rwl structure, and call rwl_new() to
- *  obtain an allocated and initialized rwl structure.
- *
- *  Then, call the appropriate functions via the provided function pointers
- *  to acquire/relinquish read or write locks on your data structure.  You
- *  may want to provide some convenience macros to make the code prettier.
- *
- *  The semantics are:
- *  - a thread attempting to obtain a read lock will succeed immediately as
- *    long as there are no threads with write locks.
- *  - a thread attempting to obtain a write lock will wait until all readers
- *    have relinquished their read locks.
- *  - a thread attempting to obtain a write lock blocks other threads from
- *    obtaining read locks.  As long as all readers release their locks,
- *    the write will eventually get the lock.
- */
-
-#include "slap.h"
-
-#include <prlock.h>
-#include <prcvar.h>
-#include "rwlock.h"
-
-/*
- * Function: __rwl_acquire_read_lock
- *
- * Description: acquire a read lock.
- *
- * Arguments: rp: pointer to an rwl stucture
- *
- * Returns: 0 on success, -1 on failure.
- */
-static int
-__rwl_acquire_read_lock( rwl *rp )
-{
-    if ( rp == NULL ) {
-	return -1;
-    }
-    PR_Lock( rp->rwl_writers_mutex );
-    PR_Lock( rp->rwl_readers_mutex );
-    rp->rwl_num_readers++;
-    (void)PR_Unlock( rp->rwl_readers_mutex );
-    (void)PR_Unlock( rp->rwl_writers_mutex );
-    return 0;
-}
-
-
-
-
-/*
- * Function: __rwl_acquire_write_lock
- *
- * Description: acquire a write lock.
- *
- * Arguments: rp: pointer to an rwl stucture
- *
- * Returns: 0 on success, -1 on failure.
- */
-static int
-__rwl_acquire_write_lock( rwl *rp )
-{
-    if ( rp == NULL ) {
-	return -1;
-    }
-    PR_Lock( rp->rwl_writers_mutex );
-    PR_Lock( rp->rwl_readers_mutex );
-    rp->rwl_writer_waiting = 1;
-    while ( rp->rwl_num_readers > 0 ) {
-	if ( PR_WaitCondVar( rp->rwl_writer_waiting_cv, PR_INTERVAL_NO_TIMEOUT ) != 0 ) {
-	    (void)PR_Unlock( rp->rwl_writers_mutex );
-	    (void)PR_Unlock( rp->rwl_readers_mutex );
-	    return -1;
-	}
-    }
-    /* XXXggood should rwl_writer_waiting be set zero here? */
-    return 0;
-}
-
-
-
-
-/*
- * Function: __rwl_relinquish_read_lock
- *
- * Description: relinquish a read lock.
- *
- * Arguments: rp: pointer to an rwl stucture
- *
- * Returns: 0 on success, -1 on failure.
- */
-static int
-__rwl_relinquish_read_lock( rwl *rp )
-{
-    if ( rp == NULL ) {
-	return -1;
-    }
-    PR_Lock( rp->rwl_readers_mutex );
-    if ( --rp->rwl_num_readers == 0 && rp->rwl_writer_waiting ) {
-	PR_NotifyCondVar( rp->rwl_writer_waiting_cv );
-    }
-    (void)PR_Unlock( rp->rwl_readers_mutex );
-    return 0;
-}
-
-
-
-
-/*
- * Function: __rwl_relinquish_write_lock
- *
- * Description: relinquish a write lock.
- *
- * Arguments: rp: pointer to an rwl stucture
- *
- * Returns: 0 on success, -1 on failure.
- */
-static int
-__rwl_relinquish_write_lock( rwl *rp )
-{
-    if ( rp == NULL ) {
-	return -1;
-    }
-    rp->rwl_writer_waiting = 0;
-    (void)PR_Unlock( rp->rwl_readers_mutex );
-    (void)PR_Unlock( rp->rwl_writers_mutex );
-    return 0;
-}
-
-
-
-/*
- * Function: rwl_new
- *
- * Description: allocate and initialize a wrl structure.
- * 
- * Arguments: none
- *
- * Returns: on success, returns a pointer to an allocated, initialized rwl structure.
- *          on failure, returns NULL.
- *
- */
-rwl *
-rwl_new()
-{
-    rwl	*rp;
-
-    rp = (rwl *)slapi_ch_malloc( sizeof( rwl ));
-    
-    if (( rp->rwl_readers_mutex = PR_NewLock()) == NULL ) {
-	slapi_ch_free( (void **)&rp );
-	return NULL;
-    }
-    if (( rp->rwl_writers_mutex = PR_NewLock()) == NULL ) {
-	PR_DestroyLock( rp->rwl_readers_mutex );
-	slapi_ch_free( (void **)&rp );
-	return NULL;
-    }
-    if (( rp->rwl_writer_waiting_cv = PR_NewCondVar( rp->rwl_readers_mutex )) == NULL ) {
-	PR_DestroyLock( rp->rwl_readers_mutex );
-	PR_DestroyLock( rp->rwl_writers_mutex );
-	slapi_ch_free( (void **)&rp );
-    }
-    rp->rwl_num_readers = rp->rwl_writer_waiting = 0;
-    
-    rp->rwl_acquire_read_lock = __rwl_acquire_read_lock;
-    rp->rwl_relinquish_read_lock = __rwl_relinquish_read_lock;
-
-    rp->rwl_acquire_write_lock = __rwl_acquire_write_lock;
-    rp->rwl_relinquish_write_lock = __rwl_relinquish_write_lock;
-
-    return rp;
-}
-
-
-
-
-/*
- * Function: rwl_free
- * 
- * Description: deallocates and frees an rwl structure.
- *
- * Arguments: rh: handle to an rwl structure.
- *
- * Returns: nothing
- */
-void
-rwl_free( rwl **rh )
-{
-    rwl	*rp;
-
-    if ( rh == NULL || *rh == NULL ) {
-	return;
-    }
-    rp = *rh;
-
-    if ( rp->rwl_readers_mutex != NULL ) {
-	PR_DestroyLock( rp->rwl_readers_mutex );
-    }
-    if ( rp->rwl_writers_mutex != NULL ) {
-	PR_DestroyLock( rp->rwl_writers_mutex );
-    }
-    if ( rp->rwl_writer_waiting_cv != NULL ) {
-	PR_DestroyCondVar( rp->rwl_writer_waiting_cv );
-    }
-    memset( rp, '\0', sizeof( rwl ));
-    slapi_ch_free( (void **)&rp );
-    *rh = NULL;
-}

+ 0 - 65
ldap/servers/slapd/rwlock.h

@@ -1,65 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * This Program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation; version 2 of the License.
- * 
- * This Program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License along with
- * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA.
- * 
- * In addition, as a special exception, Red Hat, Inc. gives You the additional
- * right to link the code of this Program with code not covered under the GNU
- * General Public License ("Non-GPL Code") and to distribute linked combinations
- * including the two, subject to the limitations in this paragraph. Non-GPL Code
- * permitted under this exception must only link to the code of this Program
- * through those well defined interfaces identified in the file named EXCEPTION
- * found in the source code files (the "Approved Interfaces"). The files of
- * Non-GPL Code may instantiate templates or use macros or inline functions from
- * the Approved Interfaces without causing the resulting work to be covered by
- * the GNU General Public License. Only Red Hat, Inc. may make changes or
- * additions to the list of Approved Interfaces. You must obey the GNU General
- * Public License in all respects for all of the Program code and other code used
- * in conjunction with the Program except the Non-GPL Code covered by this
- * exception. If you modify this file, you may extend this exception to your
- * version of the file, but you are not obligated to do so. If you do not wish to
- * provide this exception without modification, you must delete this exception
- * statement from your version and license this file solely under the GPL without
- * exception. 
- * 
- * 
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#ifndef _RWLOCK_H_
-#define _RWLOCK_H_
-
-#include <prlock.h>
-#include <prcvar.h>
-
-typedef struct _rwl {
-    PRLock	*rwl_readers_mutex;
-    PRLock	*rwl_writers_mutex;
-    PRCondVar	*rwl_writer_waiting_cv;
-    int		rwl_num_readers;
-    int		rwl_writer_waiting;
-
-    int		(*rwl_acquire_read_lock)( struct _rwl * );
-    int		(*rwl_relinquish_read_lock)( struct _rwl * );
-
-    int		(*rwl_acquire_write_lock)( struct _rwl * );
-    int		(*rwl_relinquish_write_lock)( struct _rwl * );
-} rwl;
-
-extern rwl *rwl_new();
-extern void rwl_free( rwl **rh );
-#endif /* _RWLOCK_H_ */

+ 10 - 11
ldap/servers/slapd/slap.h

@@ -167,7 +167,6 @@ typedef struct symbol_t {
 #include "ldif.h"
 #include "ldaplog.h"
 #include "portable.h"
-#include "rwlock.h"
 #include "disconnect_errors.h"
 
 #include "csngen.h"
@@ -1652,17 +1651,17 @@ typedef struct ref {
 
 /* The head of the referral array. */
 typedef struct ref_array {
-    rwl	     *ra_rwlock;    /* Read-write lock struct to protect this thing */
+    Slapi_RWLock	     *ra_rwlock;    /* Read-write lock struct to protect this thing */
     int       ra_size;      /* The size of this puppy (NOT the number of entries)*/
     int       ra_nextindex; /* The next free index */
     int       ra_readcount; /* The number of copyingfroms in the list */
     Ref     **ra_refs;      /* The array of referrals*/
 } Ref_Array;
 
-#define GR_LOCK_READ()    grefs->ra_rwlock->rwl_acquire_read_lock( grefs->ra_rwlock)
-#define GR_UNLOCK_READ()  grefs->ra_rwlock->rwl_relinquish_read_lock( grefs->ra_rwlock )
-#define GR_LOCK_WRITE()   grefs->ra_rwlock->rwl_acquire_write_lock( grefs->ra_rwlock )
-#define GR_UNLOCK_WRITE() grefs->ra_rwlock->rwl_relinquish_write_lock( grefs->ra_rwlock )
+#define GR_LOCK_READ()    slapi_rwlock_rdlock(grefs->ra_rwlock)
+#define GR_UNLOCK_READ()  slapi_rwlock_unlock(grefs->ra_rwlock)
+#define GR_LOCK_WRITE()   slapi_rwlock_wrlock(grefs->ra_rwlock)
+#define GR_UNLOCK_WRITE() slapi_rwlock_unlock(grefs->ra_rwlock)
 
 /*
  * This structure is used to pass a pair of port numbers to the daemon
@@ -1980,10 +1979,10 @@ typedef struct _slapdEntryPoints {
 /* flag used to indicate that the change to the config parameter should be saved */
 #define CONFIG_APPLY 1
 
-#define CFG_LOCK_READ(cfg)   cfg->cfg_rwlock->rwl_acquire_read_lock( cfg->cfg_rwlock )
-#define CFG_UNLOCK_READ(cfg) cfg->cfg_rwlock->rwl_relinquish_read_lock( cfg->cfg_rwlock )
-#define CFG_LOCK_WRITE(cfg)   cfg->cfg_rwlock->rwl_acquire_write_lock( cfg->cfg_rwlock )
-#define CFG_UNLOCK_WRITE(cfg) cfg->cfg_rwlock->rwl_relinquish_write_lock( cfg->cfg_rwlock )
+#define CFG_LOCK_READ(cfg)   slapi_rwlock_rdlock(cfg->cfg_rwlock)
+#define CFG_UNLOCK_READ(cfg) slapi_rwlock_unlock(cfg->cfg_rwlock)
+#define CFG_LOCK_WRITE(cfg)   slapi_rwlock_wrlock(cfg->cfg_rwlock)
+#define CFG_UNLOCK_WRITE(cfg) slapi_rwlock_unlock(cfg->cfg_rwlock)
 
 #define REFER_MODE_OFF 0 
 #define REFER_MODE_ON 1
@@ -2020,7 +2019,7 @@ typedef struct passwordpolicyarray {
 } passwdPolicy;
 
 typedef struct _slapdFrontendConfig {
-  rwl    *cfg_rwlock;       /* read/write lock to serialize access */
+  Slapi_RWLock     *cfg_rwlock;       /* read/write lock to serialize access */
   struct pw_scheme *rootpwstoragescheme;
   int accesscontrol;
   int groupevalnestlevel;

+ 0 - 169
lib/base/rwlock.cpp

@@ -1,169 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * This Program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation; version 2 of the License.
- * 
- * This Program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License along with
- * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA.
- * 
- * In addition, as a special exception, Red Hat, Inc. gives You the additional
- * right to link the code of this Program with code not covered under the GNU
- * General Public License ("Non-GPL Code") and to distribute linked combinations
- * including the two, subject to the limitations in this paragraph. Non-GPL Code
- * permitted under this exception must only link to the code of this Program
- * through those well defined interfaces identified in the file named EXCEPTION
- * found in the source code files (the "Approved Interfaces"). The files of
- * Non-GPL Code may instantiate templates or use macros or inline functions from
- * the Approved Interfaces without causing the resulting work to be covered by
- * the GNU General Public License. Only Red Hat, Inc. may make changes or
- * additions to the list of Approved Interfaces. You must obey the GNU General
- * Public License in all respects for all of the Program code and other code used
- * in conjunction with the Program except the Non-GPL Code covered by this
- * exception. If you modify this file, you may extend this exception to your
- * version of the file, but you are not obligated to do so. If you do not wish to
- * provide this exception without modification, you must delete this exception
- * statement from your version and license this file solely under the GPL without
- * exception. 
- * 
- * 
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#include <stdlib.h>
-#include "crit.h"
-#include "rwlock.h"
-
-/*
- * rwLock.c
- *    Implements a shared/exclusive lock package atop the
- * critical section/condition variables. It allows multiple
- * shared lock holders and only one exclusive lock holder
- * on a lock variable.
- *
- * NOTE : It currently favors writers over readers and writers
- *  may starve readers. It is usually preferable to allow updates
- *  if they are not as frequent. We may have to change this if
- *  the common usage pattern differs from this.
- */
-
-typedef struct {
-    CRITICAL crit;           /* Short term crit to synchronize lock ops */
-    CONDVAR  readFree;       /* Indicates lock is free for readers */
-    CONDVAR  writeFree;      /* Indicates lock is free for the writer */
-    int      numReaders;     /* Number of read locks held */
-    int      write;          /* Flag to indicate write lock held */
-    int      numWriteWaiters;/* Number of threads waiting for write lock */
-} rwLock_t;
-
-/* 
- * rwlock_init()
- *   Allocate and initialize the rwlock structure and return
- *  to the caller.
- */
-RWLOCK rwlock_Init()
-{
-    rwLock_t *rwLockP;
-
-    rwLockP = (rwLock_t *)PERM_MALLOC(sizeof(rwLock_t));
-    rwLockP->numReaders = 0;
-    rwLockP->write = 0;
-    rwLockP->numWriteWaiters = 0;
-    rwLockP->crit = crit_init();
-    rwLockP->readFree = condvar_init(rwLockP->crit);
-    rwLockP->writeFree = condvar_init(rwLockP->crit);
-    return((RWLOCK)rwLockP);
-}
-
-/* 
- * rwlock_terminate()
- *   Terminate the associated condvars and critical sections
- */
-void rwlock_Terminate(RWLOCK lockP)
-{
-    rwLock_t   *rwLockP = (rwLock_t *)lockP;
-    
-    crit_terminate(rwLockP->crit);
-    condvar_terminate(rwLockP->readFree);
-    condvar_terminate(rwLockP->writeFree);
-    PERM_FREE(rwLockP);
-}
-
-/*
- * rwlock_ReadLock -- Obtain a shared lock. The caller would
- *  block if there are writers or writeWaiters.
- */
-void rwlock_ReadLock(RWLOCK lockP)
-{
-    rwLock_t *rwLockP = (rwLock_t *)lockP;
-
-    crit_enter(rwLockP->crit);                 
-    while (rwLockP->write || rwLockP->numWriteWaiters != 0)
-        condvar_wait(rwLockP->readFree);
-    rwLockP->numReaders++;                              
-    crit_exit(rwLockP->crit);                 
-}
-
-/*
- * rwlock_writeLock -- Obtain an exclusive lock. The caller would
- * block if there are other readers or a writer.
- */
-void rwlock_WriteLock(RWLOCK lockP)
-{
-    rwLock_t *rwLockP = (rwLock_t *)lockP;
-
-    crit_enter(rwLockP->crit);                 
-    rwLockP->numWriteWaiters++;                                
-    while (rwLockP->numReaders != 0 || rwLockP->write)             
-        condvar_wait(rwLockP->writeFree);      
-    rwLockP->numWriteWaiters--;                                
-    rwLockP->write = 1;                                   
-    crit_exit(rwLockP->crit);                 
-}
-
-/*
- * rw_Unlock -- Releases the lock. 
- */
-void rwlock_Unlock(RWLOCK lockP)
-{
-    rwLock_t *rwLockP = (rwLock_t *)lockP;
-                                                         
-    crit_enter(rwLockP->crit);                 
-    if (rwLockP->write)                                      
-        rwLockP->write = 0;                              
-    else                                                 
-        rwLockP->numReaders--;                                 
-    if (rwLockP->numReaders == 0) {
-        if (rwLockP->numWriteWaiters != 0)                     
-            condvar_notify(rwLockP->writeFree);             
-        else                                             
-            condvar_notifyAll(rwLockP->readFree);           
-    }
-    crit_exit(rwLockP->crit);                 
-}
-                                                         
-/*
- * rwlock_DemoteLock -- Change an exclusive lock on the given lock
- * variable into a shared lock.  
- */
-void rwlock_DemoteLock(RWLOCK lockP)
-{
-    rwLock_t *rwLockP = (rwLock_t *)lockP;
-                                                         
-    crit_enter(rwLockP->crit);                 
-    rwLockP->numReaders = 1;
-    rwLockP->write = 0;
-    if (rwLockP->numWriteWaiters == 0)
-        condvar_notifyAll(rwLockP->readFree);
-    crit_exit(rwLockP->crit);                 
-}

File diff ditekan karena terlalu besar
+ 194 - 568
ltmain.sh


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini