[niepce] * Remove boost::thread and use Glibmm instead.



commit 617c1647adee381eb7a8babd7255e5c282b4db52
Author: Hubert Figuiere <hub figuiere net>
Date:   Sat May 2 00:27:36 2009 -0400

    	* Remove boost::thread and use Glibmm instead.
---
 ChangeLog                                |    4 +++
 README                                   |    1 -
 configure.ac                             |    1 -
 src/engine/db/Makefile.am                |    4 +-
 src/engine/db/library.cpp                |    2 +-
 src/engine/library/Makefile.am           |    2 +-
 src/fwk/toolkit/notification.hpp         |    7 +++--
 src/fwk/toolkit/notificationcenter.cpp   |    2 +-
 src/fwk/utils/Makefile.am                |   21 ++++++++++---------
 src/fwk/utils/db/sqlite/sqlitecnxdrv.cpp |   32 +++++++++++++++---------------
 src/fwk/utils/db/sqlite/sqlitecnxdrv.h   |    5 ++-
 src/fwk/utils/debug.cpp                  |    6 ++--
 src/fwk/utils/mtqueue.h                  |   16 +++++++-------
 src/fwk/utils/thread.cpp                 |    5 +---
 src/fwk/utils/thread.h                   |    6 ++--
 src/fwk/utils/worker.h                   |    8 ++----
 src/libraryclient/Makefile.am            |    4 +-
 src/libraryclient/clientimpl.cpp         |    1 +
 src/libraryclient/test_worker.cpp        |    4 +++
 src/niepce/Makefile.am                   |    5 +--
 src/niepce/main.cpp                      |    6 ++++-
 21 files changed, 75 insertions(+), 67 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2f5fb20..56672a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-05-02  Hubert Figuiere  <hub figuiere net>
+
+	* Remove boost::thread and use Glibmm instead.
+
 2009-05-01  Hubert Figuiere  <hub figuiere net>
 
 	* Gtk header cleanup. See 
diff --git a/README b/README
index 1194c31..a2796db 100644
--- a/README
+++ b/README
@@ -31,7 +31,6 @@ gnome-vfs >= 2.14
 sqlite3
 libxml > 2.5.0
 boost 1.34
- -boost thread
  -boost filesystem
  -boost test (for the unit test)
 exempi >= 2.0.0
diff --git a/configure.ac b/configure.ac
index b4b9634..28ea2f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -111,7 +111,6 @@ BOOST_FORMAT
 BOOST_FUNCTION
 BOOST_SMART_PTR
 BOOST_TEST([s])
-BOOST_THREADS
 
 AC_LANG_PUSH(C++)
 if test "$GCC" = "yes"; then
diff --git a/src/engine/db/Makefile.am b/src/engine/db/Makefile.am
index 0e4e8f4..6279ab6 100644
--- a/src/engine/db/Makefile.am
+++ b/src/engine/db/Makefile.am
@@ -2,7 +2,7 @@
 
 SUBDIRS = 
 
-INCLUDES = -I$(top_srcdir)/src/  @EXEMPI_CFLAGS@
+INCLUDES = -I$(top_srcdir)/src/  @EXEMPI_CFLAGS@ @LIBGLIBMM_CFLAGS@
 
 TESTS = test_library test_filebundle
 
@@ -14,7 +14,7 @@ TEST_LIBS =  \
 	@LIBGTKMM_LIBS@ @GNOMEVFS_LIBS@ \
 	@BOOST_UNIT_TEST_FRAMEWORK_LIBS@ \
 	@BOOST_FILESYSTEM_LIBS@ \
-	@BOOST_THREAD_LIBS@ \
+	@LIBGLIBMM_LIBS@ \
 	@SQLITE3_LIBS@ @EXEMPI_LIBS@
 
 check_PROGRAMS = test_library test_filebundle
diff --git a/src/engine/db/library.cpp b/src/engine/db/library.cpp
index 21b3ea7..6f076e0 100644
--- a/src/engine/db/library.cpp
+++ b/src/engine/db/library.cpp
@@ -84,7 +84,7 @@ void Library::notify(NotifyType t, const boost::any & param)
         DBG_OUT("notif");
         // pass the notification
         fwk::Notification::Ptr n(new fwk::Notification(niepce::NOTIFICATION_LIB));
-        fwk::Notification::mutex_t::scoped_lock lock(n->mutex());
+        fwk::Notification::mutex_t::Lock lock(n->mutex());
         LibNotification ln;
         ln.type = t;
         ln.param = param;
diff --git a/src/engine/library/Makefile.am b/src/engine/library/Makefile.am
index d82cdb2..8727667 100644
--- a/src/engine/library/Makefile.am
+++ b/src/engine/library/Makefile.am
@@ -11,7 +11,7 @@ TEST_LIBS =  \
         $(top_builddir)/src/fwk/utils/libniepceutils.a \
 	$(top_builddir)/src/fwk/toolkit/libniepceframework.a \
         @BOOST_UNIT_TEST_FRAMEWORK_LIBS@ \
-	@BOOST_THREAD_LIBS@ @BOOST_FILESYSTEM_LIBS@ \
+	@LIBGLIBMM_LIBS@ @BOOST_FILESYSTEM_LIBS@ \
 	@LIBGTKMM_LIBS@ @SQLITE3_LIBS@ @OPENRAW_LIBS@
 
 noinst_LIBRARIES = libniepcelibrary.a
diff --git a/src/fwk/toolkit/notification.hpp b/src/fwk/toolkit/notification.hpp
index f113be0..bf25a1e 100644
--- a/src/fwk/toolkit/notification.hpp
+++ b/src/fwk/toolkit/notification.hpp
@@ -26,7 +26,8 @@
 
 #include <boost/shared_ptr.hpp>
 #include <boost/any.hpp>
-#include <boost/thread/recursive_mutex.hpp>
+
+#include <glibmm/thread.h>
 
 namespace fwk {
 
@@ -35,13 +36,13 @@ namespace fwk {
 	{
 	public:
 		typedef boost::shared_ptr<Notification> Ptr;
-		typedef boost::recursive_mutex mutex_t;
+		typedef Glib::RecMutex mutex_t;
 
 		Notification(int _type)
 			: m_type(_type)
 			{}
 		~Notification()
-			{ mutex_t::scoped_lock lock(m_mutex); }
+			{ mutex_t::Lock lock(m_mutex); }
 		mutex_t & mutex() const
 			{ return m_mutex; }
 		int type() const
diff --git a/src/fwk/toolkit/notificationcenter.cpp b/src/fwk/toolkit/notificationcenter.cpp
index 95e91a2..36f3b4e 100644
--- a/src/fwk/toolkit/notificationcenter.cpp
+++ b/src/fwk/toolkit/notificationcenter.cpp
@@ -79,7 +79,7 @@ namespace fwk {
 	{
 		Notification::Ptr notif( p->m_notificationQueue.pop() );
 
-		Notification::mutex_t::scoped_lock lock(notif->mutex());
+		Notification::mutex_t::Lock lock(notif->mutex());
 		const Priv::SubscriberList & subscriber_list(p->m_subscribers[notif->type()]);
 		std::for_each(subscriber_list.begin(), subscriber_list.end(), 
 					  bind(boost::apply<void>(), _1, boost::ref(notif)));
diff --git a/src/fwk/utils/Makefile.am b/src/fwk/utils/Makefile.am
index 05b2313..e130f27 100644
--- a/src/fwk/utils/Makefile.am
+++ b/src/fwk/utils/Makefile.am
@@ -1,7 +1,8 @@
 
 DIST_SUBDIRS = db
 
-INCLUDES = -I$(top_srcdir)/src/ @EXEMPI_CFLAGS@ @LIBXML2_CFLAGS@
+INCLUDES = -I$(top_srcdir)/src/ @LIBGLIBMM_CFLAGS@ \
+	@EXEMPI_CFLAGS@ @LIBXML2_CFLAGS@
 
 TESTS = testmoniker testfiles testgeometry testxmp \
 	teststringutils test_db test_db2 test_db3 test_db4 testufrawmeta
@@ -13,47 +14,47 @@ check_PROGRAMS = testmoniker testfiles testgeometry testxmp \
 
 testmoniker_SOURCES = testmoniker.cpp
 testmoniker_LDADD = libniepceutils.a \
-	@BOOST_THREAD_LIBS@
+	@LIBGLIBMM_LIBS@
 
 testfiles_SOURCES = testfiles.cpp
 testfiles_LDADD = libniepceutils.a \
-	@BOOST_FILESYSTEM_LIBS@ @BOOST_THREAD_LIBS@
+	@BOOST_FILESYSTEM_LIBS@ @LIBGLIBMM_LIBS@
 
 testgeometry_SOURCES = testgeometry.cpp
 testgeometry_LDADD = libniepceutils.a \
-	@BOOST_THREAD_LIBS@
+	@LIBGLIBMM_LIBS@
 
 testxmp_SOURCES = testxmp.cpp
 testxmp_LDADD = libniepceutils.a \
-	@EXEMPI_LIBS@ @BOOST_FILESYSTEM_LIBS@ @BOOST_THREAD_LIBS@
+	@EXEMPI_LIBS@ @BOOST_FILESYSTEM_LIBS@ @LIBGLIBMM_LIBS@
 
 testufrawmeta_SOURCES = testufrawmeta.cpp
 testufrawmeta_CXXFLAGS =  -g -O0
 testufrawmeta_LDADD = libniepceutils.a \
 	@EXEMPI_LIBS@ @BOOST_FILESYSTEM_LIBS@ @LIBXML2_LIBS@ \
-	@BOOST_THREAD_LIBS@
+	@LIBGLIBMM_LIBS@
 
 teststringutils_SOURCES = teststringutils.cpp
 teststringutils_LDADD = 
 
 test_db_SOURCES = db/test_db.cpp
 test_db_LDADD = libniepceutils.a \
-	@BOOST_THREAD_LIBS \
+	@LIBGLIBMM_LIBS \
 	@SQLITE3_LIBS@
 
 test_db2_SOURCES = db/test_db2.cpp
 test_db2_LDADD = libniepceutils.a \
-	@BOOST_THREAD_LIBS \
+	@LIBGLIBMM_LIBS \
 	@SQLITE3_LIBS@
 
 test_db3_SOURCES = db/test_db3.cpp
 test_db3_LDADD = libniepceutils.a \
-	@BOOST_THREAD_LIBS \
+	@LIBGLIBMM_LIBS \
 	@SQLITE3_LIBS@
 
 test_db4_SOURCES = db/test_db4.cpp
 test_db4_LDADD = libniepceutils.a \
-	@BOOST_THREAD_LIBS \
+	@LIBGLIBMM_LIBS \
 	@SQLITE3_LIBS@
 
 noinst_LIBRARIES = libniepceutils.a
diff --git a/src/fwk/utils/db/sqlite/sqlitecnxdrv.cpp b/src/fwk/utils/db/sqlite/sqlitecnxdrv.cpp
index cf1651f..e65b918 100644
--- a/src/fwk/utils/db/sqlite/sqlitecnxdrv.cpp
+++ b/src/fwk/utils/db/sqlite/sqlitecnxdrv.cpp
@@ -211,7 +211,7 @@ namespace db { namespace sqlite {
 
 		SqliteCnxDrv::SqliteCnxDrv (sqlite3 *a_sqlite_handle)
 		{
-			boost::recursive_mutex::scoped_lock lock(m_mutex);
+      Glib::RecMutex::Lock lock(m_mutex);
 			THROW_IF_FAIL (a_sqlite_handle) ;
 			m_priv.reset (new Priv) ;
 			m_priv->sqlite.reset (a_sqlite_handle) ;
@@ -219,7 +219,7 @@ namespace db { namespace sqlite {
 
 		SqliteCnxDrv::~SqliteCnxDrv ()
 		{
-			boost::recursive_mutex::scoped_lock lock(m_mutex);
+      Glib::RecMutex::Lock lock(m_mutex);
 			close () ;
 			m_priv.reset(NULL);
 		}
@@ -235,7 +235,7 @@ namespace db { namespace sqlite {
 		const char*
 		SqliteCnxDrv::get_last_error () const
 		{
-			boost::recursive_mutex::scoped_lock lock(m_mutex);
+      Glib::RecMutex::Lock lock(m_mutex);
 			if (m_priv && m_priv->sqlite) {
 				return sqlite3_errmsg (m_priv->sqlite.get ());
 			}
@@ -266,7 +266,7 @@ namespace db { namespace sqlite {
 		bool
 		SqliteCnxDrv::execute_statement (const SQLStatement &a_statement)
 		{
-		  boost::recursive_mutex::scoped_lock lock(m_mutex);
+      Glib::RecMutex::Lock lock(m_mutex);
 
 		  THROW_IF_FAIL (m_priv && m_priv->sqlite) ;
 		  DBG_OUT("sql string: %s", a_statement.to_string().c_str()) ;
@@ -370,7 +370,7 @@ namespace db { namespace sqlite {
 		bool
 		SqliteCnxDrv::should_have_data () const
 		{
-			boost::recursive_mutex::scoped_lock lock(m_mutex);
+      Glib::RecMutex::Lock lock(m_mutex);
 			THROW_IF_FAIL (m_priv) ;
 
 			if (get_number_of_columns () > 0)
@@ -381,7 +381,7 @@ namespace db { namespace sqlite {
 		bool
 		SqliteCnxDrv::read_next_row ()
 		{
-			boost::recursive_mutex::scoped_lock lock(m_mutex);
+      Glib::RecMutex::Lock lock(m_mutex);
 			THROW_IF_FAIL (m_priv) ;
 			if (m_priv->cur_stmt) {
 				if (m_priv->last_execution_result == SQLITE_DONE) {
@@ -404,7 +404,7 @@ namespace db { namespace sqlite {
 		unsigned int
 		SqliteCnxDrv::get_number_of_columns () const
 		{
-			boost::recursive_mutex::scoped_lock lock(m_mutex);
+      Glib::RecMutex::Lock lock(m_mutex);
 			THROW_IF_FAIL (m_priv) ;
 			if (!m_priv->cur_stmt)
 				return 0 ;
@@ -415,7 +415,7 @@ namespace db { namespace sqlite {
 		SqliteCnxDrv::get_column_content (uint32_t a_offset,
 										  utils::Buffer &a_column_content) const
 		{
-			boost::recursive_mutex::scoped_lock lock(m_mutex);
+      Glib::RecMutex::Lock lock(m_mutex);
 			THROW_IF_FAIL (m_priv) ;
 
 			RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false) ;
@@ -429,7 +429,7 @@ namespace db { namespace sqlite {
 		SqliteCnxDrv::get_column_content (uint32_t a_offset,
 										  int32_t &a_column_content) const
 		{
-			boost::recursive_mutex::scoped_lock lock(m_mutex);
+      Glib::RecMutex::Lock lock(m_mutex);
 			THROW_IF_FAIL (m_priv) ;
 
 			RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false) ;
@@ -447,7 +447,7 @@ namespace db { namespace sqlite {
 		SqliteCnxDrv::get_column_content (uint32_t a_offset,
 										  int64_t &a_column_content) const
 		{
-			boost::recursive_mutex::scoped_lock lock(m_mutex);
+      Glib::RecMutex::Lock lock(m_mutex);
 			THROW_IF_FAIL (m_priv) ;
 
 			RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false) ;
@@ -466,7 +466,7 @@ namespace db { namespace sqlite {
 		SqliteCnxDrv::get_column_content (uint32_t a_offset,
 										  double& a_column_content) const
 		{
-			boost::recursive_mutex::scoped_lock lock(m_mutex);
+      Glib::RecMutex::Lock lock(m_mutex);
 			THROW_IF_FAIL (m_priv) ;
 			RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false) ;
 			int type = sqlite3_column_type (m_priv->cur_stmt, a_offset) ;
@@ -482,7 +482,7 @@ namespace db { namespace sqlite {
 		SqliteCnxDrv::get_column_content (uint32_t a_offset,
 										  std::string& a_column_content) const
 		{
-			boost::recursive_mutex::scoped_lock lock(m_mutex);
+      Glib::RecMutex::Lock lock(m_mutex);
 			THROW_IF_FAIL (m_priv) ;
 
 			RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false) ;
@@ -506,7 +506,7 @@ namespace db { namespace sqlite {
 		SqliteCnxDrv::get_column_type (uint32_t a_offset,
 									   enum ColumnType &a_type) const
 		{
-			boost::recursive_mutex::scoped_lock lock(m_mutex);
+      Glib::RecMutex::Lock lock(m_mutex);
 			THROW_IF_FAIL (m_priv) ;
 			RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false) ;
 			int type = sqlite3_column_type (m_priv->cur_stmt, a_offset) ;
@@ -538,7 +538,7 @@ namespace db { namespace sqlite {
 		bool
 		SqliteCnxDrv::get_column_name (uint32_t a_offset, utils::Buffer &a_name) const
 		{
-			boost::recursive_mutex::scoped_lock lock(m_mutex);
+      Glib::RecMutex::Lock lock(m_mutex);
 			THROW_IF_FAIL (m_priv) ;
 			RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false) ;
 			const char* name = sqlite3_column_name (m_priv->cur_stmt, a_offset) ;
@@ -551,7 +551,7 @@ namespace db { namespace sqlite {
 		void
 		SqliteCnxDrv::close ()
 		{
-			boost::recursive_mutex::scoped_lock lock(m_mutex);
+      Glib::RecMutex::Lock lock(m_mutex);
 			THROW_IF_FAIL (m_priv) ;
 
 			if (m_priv->sqlite) {
@@ -565,7 +565,7 @@ namespace db { namespace sqlite {
 		int64_t
 		SqliteCnxDrv::last_row_id()
 		{
-			boost::recursive_mutex::scoped_lock lock(m_mutex);
+      Glib::RecMutex::Lock lock(m_mutex);
 			THROW_IF_FAIL (m_priv);
 			if (m_priv->sqlite) {
 				return sqlite3_last_insert_rowid(m_priv->sqlite.get());
diff --git a/src/fwk/utils/db/sqlite/sqlitecnxdrv.h b/src/fwk/utils/db/sqlite/sqlitecnxdrv.h
index b20e2ca..c6f7d9f 100644
--- a/src/fwk/utils/db/sqlite/sqlitecnxdrv.h
+++ b/src/fwk/utils/db/sqlite/sqlitecnxdrv.h
@@ -28,7 +28,8 @@
 #define __NEMIVER_SQLITE_CNX_DRV_H__
 
 #include <boost/scoped_ptr.hpp>
-#include <boost/thread/recursive_mutex.hpp>
+
+#include <glibmm/thread.h>
 
 #include "fwk/utils/db/iconnectiondriver.h"
 
@@ -43,7 +44,7 @@ class SqliteCnxDrv: public db::IConnectionDriver {
     struct Priv ;
     friend class SqliteCnxMgrDrv ;
     boost::scoped_ptr<Priv> m_priv ;
-    mutable boost::recursive_mutex m_mutex;
+    mutable Glib::RecMutex m_mutex;
 
     friend void boost::checked_delete<SqliteCnxDrv>(SqliteCnxDrv * x);
 
diff --git a/src/fwk/utils/debug.cpp b/src/fwk/utils/debug.cpp
index d9c3e9f..15ebc45 100644
--- a/src/fwk/utils/debug.cpp
+++ b/src/fwk/utils/debug.cpp
@@ -34,7 +34,7 @@
 #define NDEBUG _SAVENDEBUG
 #endif
 
-#include <boost/thread/recursive_mutex.hpp>
+#include <glibmm/thread.h>
 
 #include "debug.h"
 
@@ -107,8 +107,8 @@ namespace utils {
 	static void _vprint(const char *prefix, const char *fmt, 
 							const char* func,	va_list marker)
 	{
-		static boost::recursive_mutex mutex;
-		boost::recursive_mutex::scoped_lock lock(mutex);
+		static Glib::RecMutex mutex;
+    Glib::RecMutex::Lock lock(mutex);
 		char buf[128];
 		snprintf(buf, 128, "(%d) ", (int)pthread_self());
 		fwrite(buf, 1, strlen(buf), stderr);
diff --git a/src/fwk/utils/mtqueue.h b/src/fwk/utils/mtqueue.h
index b0ec397..8281ec4 100644
--- a/src/fwk/utils/mtqueue.h
+++ b/src/fwk/utils/mtqueue.h
@@ -23,7 +23,7 @@
 #define __NIEPCE_UTILS_MTQUEUE_H__
 
 #include <deque>
-#include <boost/thread/recursive_mutex.hpp>
+#include <glibmm/thread.h>
 
 namespace utils {
 
@@ -36,8 +36,8 @@ namespace utils {
 	class MtQueue
 	{
 	public:
-		typedef boost::recursive_mutex mutex_t;
-		typedef T                      value_type;
+		typedef Glib::RecMutex mutex_t;
+		typedef T              value_type;
 
 		MtQueue();
 		virtual ~MtQueue();
@@ -64,13 +64,13 @@ namespace utils {
 	template < class T >
 	MtQueue<T>::~MtQueue()
 	{
-		mutex_t::scoped_lock lock(m_mutex);		
+		mutex_t::Lock lock(m_mutex);		
 	}
 
 	template < class T > void
 	MtQueue<T>::add(const T &op)
 	{
-		mutex_t::scoped_lock lock(m_mutex);
+		mutex_t::Lock lock(m_mutex);
 		m_queue.push_back(op);
 	}
 
@@ -79,7 +79,7 @@ namespace utils {
 	T MtQueue<T>::pop()
 	{
 		T elem;
-		mutex_t::scoped_lock lock(m_mutex);		
+		mutex_t::Lock lock(m_mutex);		
 		elem = m_queue.front();
 		m_queue.pop_front();
 		return elem;
@@ -89,14 +89,14 @@ namespace utils {
 	template < class T >
 	bool MtQueue<T>::empty() const
 	{
-		mutex_t::scoped_lock lock(m_mutex);
+		mutex_t::Lock lock(m_mutex);
 		return m_queue.empty();
 	}
 
 	template < class T >
 	void MtQueue<T>::clear() 
 	{
-		mutex_t::scoped_lock lock(m_mutex);
+		mutex_t::Lock lock(m_mutex);
 		m_queue.clear();
 	}
 }
diff --git a/src/fwk/utils/thread.cpp b/src/fwk/utils/thread.cpp
index 0ed7bed..2af2e1f 100644
--- a/src/fwk/utils/thread.cpp
+++ b/src/fwk/utils/thread.cpp
@@ -18,8 +18,6 @@
  */
 
 
-#include <boost/bind.hpp>
-
 #include "thread.h"
 
 namespace utils {
@@ -53,8 +51,7 @@ namespace utils {
 
 	void Thread::start()
 	{
-		m_thrd = m_threads.create_thread(
-			boost::bind(&Thread::main, this));
+		m_thrd = Glib::Thread::create(sigc::mem_fun(*this, &Thread::main), true);
 // TODO add this thread to a manager for task management.
 //		thrd->join();
 	}
diff --git a/src/fwk/utils/thread.h b/src/fwk/utils/thread.h
index aa363bc..d3a95e1 100644
--- a/src/fwk/utils/thread.h
+++ b/src/fwk/utils/thread.h
@@ -23,7 +23,8 @@
 
 
 #include <string>
-#include <boost/thread.hpp>
+
+#include <glibmm/thread.h>
 
 
 namespace utils {
@@ -43,8 +44,7 @@ namespace utils {
 		virtual void main() = 0;
 		volatile bool m_terminated;
 	private:
-		boost::thread *       m_thrd;
-		boost::thread_group   m_threads;
+    Glib::Thread *       m_thrd;
 	};
 
 }
diff --git a/src/fwk/utils/worker.h b/src/fwk/utils/worker.h
index dae5334..d89274a 100644
--- a/src/fwk/utils/worker.h
+++ b/src/fwk/utils/worker.h
@@ -23,8 +23,6 @@
 
 
 #include <string>
-#include <boost/thread.hpp>
-#include <boost/bind.hpp>
 
 #include "fwk/utils/thread.h"
 #include "fwk/utils/mtqueue.h"
@@ -64,7 +62,7 @@ namespace utils {
 	template <class T>
 	Worker<T>::~Worker()
 	{
-		typename queue_t::mutex_t::scoped_lock lock(m_tasks.mutex());
+		typename queue_t::mutex_t::Lock lock(m_tasks.mutex());
 		m_tasks.clear();
 	}
 
@@ -80,7 +78,7 @@ namespace utils {
 			{
 				// make sure we terminate the thread before we unlock
 				// the task queue.
-				typename queue_t::mutex_t::scoped_lock lock(m_tasks.mutex());
+				typename queue_t::mutex_t::Lock lock(m_tasks.mutex());
 				if(m_tasks.empty()) {
 					m_terminated = true;
 					break;
@@ -94,7 +92,7 @@ namespace utils {
 	template <class T>
 	void Worker<T>::schedule(const T & _op)
 	{
-		typename queue_t::mutex_t::scoped_lock lock(m_tasks.mutex());
+		typename queue_t::mutex_t::Lock lock(m_tasks.mutex());
 		bool was_empty = m_tasks.empty();
 		m_tasks.add(_op);
 		if(was_empty) {
diff --git a/src/libraryclient/Makefile.am b/src/libraryclient/Makefile.am
index c58e789..c75ab8c 100644
--- a/src/libraryclient/Makefile.am
+++ b/src/libraryclient/Makefile.am
@@ -1,6 +1,6 @@
 
 
-INCLUDES = -I$(top_srcdir)/src @EXEMPI_CFLAGS@
+INCLUDES = -I$(top_srcdir)/src @EXEMPI_CFLAGS@ @LIBGLIBMM_CFLAGS@
 
 noinst_LIBRARIES = liblibraryclient.a
 
@@ -14,7 +14,7 @@ TEST_LIBS =  \
 	$(top_builddir)/src/fwk/toolkit/libniepceframework.a \
 	$(top_builddir)/src/fwk/libfwk.a \
         @BOOST_UNIT_TEST_FRAMEWORK_LIBS@ \
-	@BOOST_THREAD_LIBS@ @BOOST_FILESYSTEM_LIBS@ \
+	@LIBGLIBMM_LIBS@ @BOOST_FILESYSTEM_LIBS@ \
 	@LIBGTKMM_LIBS@ @SQLITE3_LIBS@ @OPENRAW_LIBS@ \
 	@EXEMPI_LIBS@ @GNOMEVFS_LIBS@
 
diff --git a/src/libraryclient/clientimpl.cpp b/src/libraryclient/clientimpl.cpp
index df7555e..43e713e 100644
--- a/src/libraryclient/clientimpl.cpp
+++ b/src/libraryclient/clientimpl.cpp
@@ -17,6 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <boost/bind.hpp>
 
 #include "fwk/utils/debug.h"
 #include "fwk/utils/files.h"
diff --git a/src/libraryclient/test_worker.cpp b/src/libraryclient/test_worker.cpp
index 0157254..492b569 100644
--- a/src/libraryclient/test_worker.cpp
+++ b/src/libraryclient/test_worker.cpp
@@ -26,6 +26,7 @@
 #include <boost/bind.hpp>
 #include <boost/test/minimal.hpp>
 
+#include <glibmm/thread.h>
 
 using namespace library;
 using namespace libraryclient;
@@ -38,6 +39,9 @@ void foo(const db::Library::Ptr &)
 //BOOST_AUTO_TEST_CASE(worker_test)
 int test_main(int, char *[])
 {
+  if(!Glib::thread_supported()) 
+    Glib::thread_init();
+
 	char templ[] = "/tmp/niepce-tmpXXXXXX";
 	char *ptempl =  mkdtemp(templ);
 	BOOST_CHECK(ptempl);
diff --git a/src/niepce/Makefile.am b/src/niepce/Makefile.am
index 039fc10..5a3eeea 100644
--- a/src/niepce/Makefile.am
+++ b/src/niepce/Makefile.am
@@ -10,8 +10,7 @@ bin_PROGRAMS = niepce
 niepce_CPPFLAGS = @LIBGTKMM_CFLAGS@ @GCONF_CFLAGS@ \
 	-DNIEPCE_LOCALEDIR=\"@NIEPCE_LOCALEDIR \"
 
-niepce_LDFLAGS = -Wl,--as-needed @BOOST_FILESYSTEM_LDFLAGS@ \
-	@BOOST_THREAD_LDFLAGS@
+niepce_LDFLAGS = -Wl,--as-needed @BOOST_FILESYSTEM_LDFLAGS@
 niepce_LDADD = \
 	$(top_builddir)/src/engine/db/libniepcedb.a \
 	$(top_builddir)/src/niepce/ui/libniepceui.a \
@@ -28,7 +27,7 @@ niepce_LDADD = \
 	$(top_builddir)/src/ext/libview/libview.a \
 	@LIBGLIBMM_LIBS@ \
 	@LIBGTKMM_LIBS@ @SQLITE3_LIBS@ \
-	@GNOMEVFS_LIBS@ @GCONF_LIBS@ @BOOST_THREAD_LIBS@ \
+	@GNOMEVFS_LIBS@ @GCONF_LIBS@ @LIBGLIBMM_LIBS@ \
 	@BOOST_FILESYSTEM_LIBS@  \
 	@GOOCANVASMM_LIBS@ @BABL_LIBS@ \
 	@GEGLMM_LIBS@ @OPENRAW_LIBS@ @EXEMPI_LIBS@
diff --git a/src/niepce/main.cpp b/src/niepce/main.cpp
index 58e4d04..261cdcc 100644
--- a/src/niepce/main.cpp
+++ b/src/niepce/main.cpp
@@ -26,6 +26,7 @@
 #include <boost/filesystem/path.hpp>
 
 #include <glibmm/i18n.h>
+#include <glibmm/thread.h>
 
 #include "fwk/utils/exempi.h"
 #include "xmp.h"
@@ -46,7 +47,10 @@ int main(int argc, char ** argv)
 	bfs::path::default_name_check(&bfs::native);
 
 	ExempiManager ex_manager(niepce::xmp_namespaces);
-	
+
+  if(!Glib::thread_supported()) 
+    Glib::thread_init();
+
 	return fwk::Application::main(
 		boost::bind(&ui::NiepceApplication::create),
 		argc, argv);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]