mirror of
https://github.com/ceph/ceph
synced 2024-12-29 15:03:33 +00:00
atomic_t: Remove (never used) unstable commonc++-based version
This commit is contained in:
parent
69b849c4bd
commit
d1d6da3b4b
21
configure.ac
21
configure.ac
@ -96,27 +96,6 @@ AS_IF([test "x$with_hadoop" != xno],
|
||||
])])
|
||||
AM_CONDITIONAL(WITH_HADOOPCLIENT, [test "$HAVE_JNI" = "1"])
|
||||
|
||||
# CommonC++?
|
||||
AC_ARG_WITH([ccgnu],
|
||||
[AS_HELP_STRING([--with-ccgnu],
|
||||
[use CommonC++ library for fast thread-safe reference counting])],
|
||||
[],
|
||||
[with_ccgnu=check])
|
||||
LIBCCGNU2=
|
||||
AS_IF([test "x$with_ccgnu" == xyes],
|
||||
[AC_CHECK_LIB([ccgnu2], [main],
|
||||
[AC_SUBST([LIBCCGNU2], ["-lccgnu2"])
|
||||
AC_DEFINE([WITH_CCGNU], [1],
|
||||
[Define if you have ccgnu])
|
||||
LIBS="-lccgnu2 -ldl $LIBS"
|
||||
],
|
||||
[if test "x$with_ccgnu" != xcheck; then
|
||||
AC_MSG_FAILURE(
|
||||
[--with-ccgnu was given but test failed])
|
||||
fi
|
||||
], [-ldl])])
|
||||
AM_CONDITIONAL(WITH_CCGNU, test "WITH_CCGNU" = "1")
|
||||
|
||||
# newsyn? requires mpi.
|
||||
#AC_ARG_WITH([newsyn],
|
||||
# [AS_HELP_STRING([--with-newsyn], [build newsyn target requires mpi])],
|
||||
|
@ -19,30 +19,6 @@
|
||||
# include "acconfig.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef WITH_CCGNU
|
||||
/*
|
||||
* use commonc++ library AtomicCounter.
|
||||
*/
|
||||
# include "cc++/thread.h"
|
||||
|
||||
namespace ceph {
|
||||
|
||||
class atomic_t {
|
||||
mutable ost::AtomicCounter nref; // mutable for const-ness of operator<<
|
||||
public:
|
||||
atomic_t(int i=0) : nref(i) {}
|
||||
void inc() { ++nref; }
|
||||
int dec() { return --nref; }
|
||||
int test() const { return nref; }
|
||||
void add(int i) { nref += i; }
|
||||
void sub(int i) { nref -= i; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
/*
|
||||
* crappy slow implementation that uses a pthreads spinlock.
|
||||
*/
|
||||
@ -86,7 +62,4 @@ public:
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user