Commit d46db24d authored by Jon Kåre Hellan's avatar Jon Kåre Hellan

Change from --{en/dis}able-withoutlocking to --{en/dis}able-locking


git-svn-id: file:///home/svn/mapi/trunk@1030 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent c0208c41
......@@ -365,16 +365,14 @@ else
fi
#No locking in mapidlib
AC_MSG_CHECKING(if locking is disabled in mapidlib)
AC_ARG_ENABLE(withoutlocking,
AS_HELP_STRING([--enable-withoutlocking], [Disable locking inside mapidlib to increase performance.]),
[case "${enableval}" in
yes) withoutlocking=true ;;
no) withoutlocking=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-withoutlocking) ;;
esac], [withoutlocking=false])
if test x$withoutlocking = xtrue; then
AC_DEFINE(WITHOUT_LOCKING, 1, [disable locking])
AC_MSG_CHECKING(if locking is enabled in mapidlib)
AC_ARG_ENABLE(locking,
AS_HELP_STRING([--enable-locking],
[Enable locking inside mapidlib. May be disabled to increase performance.]),
enable_locking="$enableval",
enable_locking=yes)
if test x$enable_locking = xyes; then
AC_DEFINE(WITH_LOCKING, 1, [enable mapidlib locking])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
......
......@@ -1139,7 +1139,7 @@ void mapid_process_pkt(mapidlib_instance_t *i,
if(funct->ref==1)
ret=funct->instance->ret;
else {
#ifndef WITHOUT_LOCKING
#ifdef WITH_LOCKING
if(funct->instance->def->restype == MAPIRES_SHM) {
pthread_mutex_lock(i->shm_spinlock);
}
......@@ -1152,7 +1152,7 @@ void mapid_process_pkt(mapidlib_instance_t *i,
#else
ret=funct->instance->def->process(funct->instance,dev_pkt,link_pkt,pkt_head);
#endif
#ifndef WITHOUT_LOCKING
#ifdef WITH_LOCKING
if(funct->instance->def->restype == MAPIRES_SHM) {
pthread_mutex_unlock(i->shm_spinlock);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment