Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpuffs Remove PUFFS_WITH_THREADS ifdef garbage, just u...



details:   https://anonhg.NetBSD.org/src/rev/5c6a9480a015
branches:  trunk
changeset: 759347:5c6a9480a015
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Dec 06 14:50:34 2010 +0000

description:
Remove PUFFS_WITH_THREADS ifdef garbage, just use libc weak symbols.

diffstat:

 lib/libpuffs/Makefile     |   7 +------
 lib/libpuffs/dispatcher.c |  16 ++--------------
 lib/libpuffs/puffs.c      |   8 +++-----
 lib/libpuffs/puffs_priv.h |  10 ++--------
 4 files changed, 8 insertions(+), 33 deletions(-)

diffs (133 lines):

diff -r 19b31f84ebc4 -r 5c6a9480a015 lib/libpuffs/Makefile
--- a/lib/libpuffs/Makefile     Mon Dec 06 14:24:11 2010 +0000
+++ b/lib/libpuffs/Makefile     Mon Dec 06 14:50:34 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.23 2009/12/05 12:13:08 pooka Exp $
+#      $NetBSD: Makefile,v 1.24 2010/12/06 14:50:34 pooka Exp $
 #
 
 .include <bsd.own.mk>
@@ -9,11 +9,6 @@
 
 LIB=           puffs
 
-# don't enable this unless you know what you're doing (or if you don't
-# know what you're doing, it's still ok to enable this if you're me)
-#LIBDPLIBS+=   pthread ${.CURDIR}/../libpthread
-#CPPFLAGS+=    -DPUFFS_WITH_THREADS
-
 SRCS=          puffs.c callcontext.c creds.c dispatcher.c flush.c      \
                framebuf.c null.c opdump.c paths.c pnode.c requests.c   \
                subr.c suspend.c
diff -r 19b31f84ebc4 -r 5c6a9480a015 lib/libpuffs/dispatcher.c
--- a/lib/libpuffs/dispatcher.c Mon Dec 06 14:24:11 2010 +0000
+++ b/lib/libpuffs/dispatcher.c Mon Dec 06 14:50:34 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dispatcher.c,v 1.34 2010/05/21 10:50:52 pooka Exp $    */
+/*     $NetBSD: dispatcher.c,v 1.35 2010/12/06 14:50:34 pooka Exp $    */
 
 /*
  * Copyright (c) 2006, 2007, 2008 Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: dispatcher.c,v 1.34 2010/05/21 10:50:52 pooka Exp $");
+__RCSID("$NetBSD: dispatcher.c,v 1.35 2010/12/06 14:50:34 pooka Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -39,9 +39,7 @@
 
 #include <assert.h>
 #include <errno.h>
-#ifdef PUFFS_WITH_THREADS
 #include <pthread.h>
-#endif
 #include <puffs.h>
 #include <puffsdump.h>
 #include <stdio.h>
@@ -50,16 +48,6 @@
 
 #include "puffs_priv.h"
 
-#if 0 /* me not worka now */
-/*
- * Set the following to 1 to handle each request in a separate pthread.
- * This is not exported as it should not be used yet unless having a
- * very good knowledge of what you're signing up for (libpuffs is not
- * threadsafe).
- */
-int puffs_usethreads;
-#endif
-
 static void dispatch(struct puffs_cc *);
 
 /* for our eyes only */
diff -r 19b31f84ebc4 -r 5c6a9480a015 lib/libpuffs/puffs.c
--- a/lib/libpuffs/puffs.c      Mon Dec 06 14:24:11 2010 +0000
+++ b/lib/libpuffs/puffs.c      Mon Dec 06 14:50:34 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs.c,v 1.114 2010/07/06 21:58:18 pooka Exp $        */
+/*     $NetBSD: puffs.c,v 1.115 2010/12/06 14:50:34 pooka Exp $        */
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: puffs.c,v 1.114 2010/07/06 21:58:18 pooka Exp $");
+__RCSID("$NetBSD: puffs.c,v 1.115 2010/12/06 14:50:34 pooka Exp $");
 #endif /* !lint */
 
 #include <sys/param.h>
@@ -43,6 +43,7 @@
 #include <fcntl.h>
 #include <mntopts.h>
 #include <paths.h>
+#include <pthread.h>
 #include <puffs.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -59,10 +60,7 @@
        MOPT_NULL,
 };
 
-#ifdef PUFFS_WITH_THREADS
-#include <pthread.h>
 pthread_mutex_t pu_lock = PTHREAD_MUTEX_INITIALIZER;
-#endif
 
 #define FILLOP(lower, upper)                                           \
 do {                                                                   \
diff -r 19b31f84ebc4 -r 5c6a9480a015 lib/libpuffs/puffs_priv.h
--- a/lib/libpuffs/puffs_priv.h Mon Dec 06 14:24:11 2010 +0000
+++ b/lib/libpuffs/puffs_priv.h Mon Dec 06 14:50:34 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs_priv.h,v 1.42 2010/01/12 18:42:39 pooka Exp $    */
+/*     $NetBSD: puffs_priv.h,v 1.43 2010/12/06 14:50:34 pooka Exp $    */
 
 /*
  * Copyright (c) 2006, 2007, 2008 Antti Kantee.  All Rights Reserved.
@@ -31,19 +31,13 @@
 #include <sys/types.h>
 #include <fs/puffs/puffs_msgif.h>
 
+#include <pthread.h>
 #include <puffs.h>
 #include <ucontext.h>
 
-#ifdef PUFFS_WITH_THREADS
-#include <pthread.h>
-
 extern pthread_mutex_t pu_lock;
 #define PU_LOCK() pthread_mutex_lock(&pu_lock)
 #define PU_UNLOCK() pthread_mutex_unlock(&pu_lock)
-#else
-#define PU_LOCK()
-#define PU_UNLOCK()
-#endif
 
 #define PU_CMAP(pu, c) (pu->pu_cmap ? pu->pu_cmap(pu,c) : (struct puffs_node*)c)
 



Home | Main Index | Thread Index | Old Index