lock in ccnx
diff --git a/include/ccnx-tunnel.h b/include/ccnx-tunnel.h
index e4b8b50..af49a9b 100644
--- a/include/ccnx-tunnel.h
+++ b/include/ccnx-tunnel.h
@@ -2,7 +2,6 @@
 #define CCNX_TUNNEL_H
 
 #include <boost/variant.hpp>
-#include <boost/thread/locks.hpp>
 
 #include "ccnx-common.h"
 #include "ccnx-wrapper.h"
@@ -27,9 +26,6 @@
 public: 
   typedef multimap<string, InterestCallback> RegisteredInterestTable;
   typedef multimap<string, InterestCallback>::iterator RitIter;
-  typedef boost::shared_mutex Lock;
-  typedef boost::unique_lock<Lock> WriteLock;
-  typedef boost::shared_lock<Lock> ReadLock;
 
 
   CcnxTunnel(); 
diff --git a/include/ccnx-wrapper.h b/include/ccnx-wrapper.h
index 8d24b19..e5754da 100644
--- a/include/ccnx-wrapper.h
+++ b/include/ccnx-wrapper.h
@@ -10,6 +10,7 @@
 #include <ccn/signing.h>
 }
 
+#include <boost/thread/locks.hpp>
 #include <boost/thread/recursive_mutex.hpp>
 #include <boost/thread/thread.hpp>
 
@@ -26,6 +27,13 @@
 class CcnxWrapper 
 {
 public:
+  typedef boost::shared_mutex Lock;
+  typedef boost::unique_lock<Lock> WriteLock;
+  typedef boost::shared_lock<Lock> ReadLock;
+
+  typedef boost::recursive_mutex RecLock;
+  typedef boost::unique_lock<RecLock> UniqueRecLock;
+
   typedef boost::function<void (const string &)> InterestCallback;
 
   CcnxWrapper();
@@ -89,7 +97,7 @@
   ccn_keystore *m_keyStore;
   ccn_charbuf *m_keyLoactor;
   // to lock, use "boost::recursive_mutex::scoped_lock scoped_lock(mutex);
-  boost::recursive_mutex m_mutex;
+  RecLock m_mutex;
   boost::thread m_thread;
   bool m_running;
   bool m_connected;
diff --git a/src/ccnx-wrapper.cpp b/src/ccnx-wrapper.cpp
index 1b791c9..041665e 100644
--- a/src/ccnx-wrapper.cpp
+++ b/src/ccnx-wrapper.cpp
@@ -59,8 +59,7 @@
 void
 CcnxWrapper::connectCcnd()
 {
-  recursive_mutex::scoped_lock lock (m_mutex);
-
+  UniqueRecLock(m_mutex);
   if (m_handle != 0) {
     ccn_disconnect (m_handle);
     ccn_destroy (&m_handle);
@@ -86,7 +85,7 @@
 CcnxWrapper::~CcnxWrapper()
 {
   {
-    recursive_mutex::scoped_lock lock(m_mutex);
+    UniqueRecLock(m_mutex);
     m_running = false;
   }
   
@@ -150,7 +149,7 @@
         {
           int res = 0;
           {
-            recursive_mutex::scoped_lock lock (m_mutex);
+            UniqueRecLock(m_mutex);
             res = ccn_run (m_handle, 0);
           }
 
@@ -163,7 +162,7 @@
 
           pollfd pfds[1];
           {
-            recursive_mutex::scoped_lock lock (m_mutex);
+            UniqueRecLock(m_mutex);
           
             pfds[0].fd = ccn_get_connection_fd (m_handle);
             pfds[0].events = POLLIN;
@@ -258,7 +257,7 @@
 int
 CcnxWrapper::putToCcnd (const Bytes &contentObject)
 {
-  recursive_mutex::scoped_lock lock(m_mutex);
+  UniqueRecLock(m_mutex);
   if (!m_running || !m_connected)
     return -1;
   
@@ -389,7 +388,7 @@
 
 int CcnxWrapper::sendInterest (const Interest &interest, Closure *closure)
 {
-  recursive_mutex::scoped_lock lock(m_mutex);
+  UniqueRecLock(m_mutex);
   if (!m_running || !m_connected)
     return -1;
   
@@ -410,7 +409,7 @@
 
 int CcnxWrapper::setInterestFilter (const string &prefix, const InterestCallback &interestCallback)
 {
-  recursive_mutex::scoped_lock lock(m_mutex);
+  UniqueRecLock(m_mutex);
   if (!m_running || !m_connected)
     return -1;
 
@@ -432,7 +431,7 @@
 void
 CcnxWrapper::clearInterestFilter (const std::string &prefix)
 {
-  recursive_mutex::scoped_lock lock(m_mutex);
+  UniqueRecLock(m_mutex);
   if (!m_running || !m_connected)
     return;