34b6398
diff -N -u -r abiword-plugins-2.6.0.orig/tools/abicollab/backends/tcp/xp/IOClientHandler.h abiword-plugins-2.6.0/tools/abicollab/backends/tcp/xp/IOClientHandler.h
34b6398
--- abiword-plugins-2.6.0.orig/tools/abicollab/backends/tcp/xp/IOClientHandler.h	2008-03-18 23:18:08.000000000 +0100
34b6398
+++ abiword-plugins-2.6.0/tools/abicollab/backends/tcp/xp/IOClientHandler.h	2008-03-29 01:53:52.000000000 +0100
34b6398
@@ -20,7 +20,6 @@
34b6398
 #define __IO_CLIENT_HANDLER__
34b6398
 
34b6398
 #include <boost/bind.hpp>
34b6398
-#include <boost/thread.hpp>
34b6398
 #include <boost/utility.hpp>
34b6398
 #include <asio.hpp>
34b6398
 
34b6398
@@ -69,7 +68,7 @@
34b6398
 		UT_return_if_fail(work == NULL);
34b6398
 		
34b6398
 		work = new asio::io_service::work(io_service);
34b6398
-		thread = new boost::thread(IOServiceThread(io_service));
34b6398
+		thread = new asio::thread(IOServiceThread(io_service));
34b6398
 		
34b6398
 		// TODO: catch exceptions
34b6398
 		asio::ip::tcp::resolver::iterator iterator(resolver.resolve(query));
34b6398
@@ -79,7 +78,7 @@
34b6398
 
34b6398
 private:
34b6398
 	asio::io_service					io_service;
34b6398
-	boost::thread*						thread;
34b6398
+	asio::thread*						thread;
34b6398
 	asio::io_service::work*				work;
34b6398
 	asio::ip::tcp::resolver				resolver;
34b6398
 	asio::ip::tcp::resolver::query		query;
34b6398
diff -N -u -r abiword-plugins-2.6.0.orig/tools/abicollab/backends/tcp/xp/IOServerHandler.h abiword-plugins-2.6.0/tools/abicollab/backends/tcp/xp/IOServerHandler.h
34b6398
--- abiword-plugins-2.6.0.orig/tools/abicollab/backends/tcp/xp/IOServerHandler.h	2008-03-18 23:18:08.000000000 +0100
34b6398
+++ abiword-plugins-2.6.0/tools/abicollab/backends/tcp/xp/IOServerHandler.h	2008-03-29 01:53:52.000000000 +0100
34b6398
@@ -22,7 +22,6 @@
34b6398
 #include "ut_debugmsg.h"
34b6398
 
34b6398
 #include <boost/bind.hpp>
34b6398
-#include <boost/thread.hpp>
34b6398
 #include <boost/utility.hpp>
34b6398
 #include <asio.hpp>
34b6398
 
34b6398
@@ -47,7 +46,7 @@
34b6398
 	{
34b6398
 		work = new asio::io_service::work(io_service);
34b6398
 		m_pAcceptor = new asio::ip::tcp::acceptor(io_service, endpoint);
34b6398
-		boost::thread thread(iot);
34b6398
+		asio::thread thread(iot);
34b6398
 	}
34b6398
 	
34b6398
 	virtual ~IOServerHandler()
34b6398
diff -N -u -r abiword-plugins-2.6.0.orig/tools/abicollab/backends/tcp/xp/Session.h abiword-plugins-2.6.0/tools/abicollab/backends/tcp/xp/Session.h
34b6398
--- abiword-plugins-2.6.0.orig/tools/abicollab/backends/tcp/xp/Session.h	2008-03-18 23:18:08.000000000 +0100
34b6398
+++ abiword-plugins-2.6.0/tools/abicollab/backends/tcp/xp/Session.h	2008-03-29 01:53:52.000000000 +0100
34b6398
@@ -20,6 +20,7 @@
34b6398
 #define __SESSION__
34b6398
 
34b6398
 #include <deque>
34b6398
+#include <backends/xp/lock.h>
34b6398
 
34b6398
 class TCPAccountHandler;
34b6398
 
34b6398
@@ -48,7 +49,7 @@
34b6398
 	void push(int size, char* data)
34b6398
 	{
34b6398
 		{
34b6398
-			boost::mutex::scoped_lock lock(queue_protector); 
34b6398
+			abicollab::scoped_lock lock(queue_protector); 
34b6398
 			incoming.push_back( std::pair<int, char*>(size, data) );
34b6398
 		}
34b6398
 		signal();
34b6398
@@ -62,7 +63,7 @@
34b6398
 		if (incoming.size() == 0)
34b6398
 			return false;
34b6398
 		{
34b6398
-			boost::mutex::scoped_lock lock(queue_protector); 
34b6398
+			abicollab::scoped_lock lock(queue_protector); 
34b6398
 			std::pair<int, char*> p = incoming.front();
34b6398
 			size = p.first;
34b6398
 			*data = p.second;
34b6398
@@ -218,7 +219,7 @@
34b6398
 	}
34b6398
 
34b6398
 	asio::ip::tcp::socket					socket;
34b6398
-	boost::mutex 							queue_protector;
34b6398
+	abicollab::mutex 							queue_protector;
34b6398
 	std::deque< std::pair<int, char*> >		incoming;
34b6398
 	std::deque< std::pair<int, char*> >		outgoing;
34b6398
 
34b6398
diff -N -u -r abiword-plugins-2.6.0.orig/tools/abicollab/backends/xp/lock.h abiword-plugins-2.6.0/tools/abicollab/backends/xp/lock.h
34b6398
--- abiword-plugins-2.6.0.orig/tools/abicollab/backends/xp/lock.h	1970-01-01 01:00:00.000000000 +0100
34b6398
+++ abiword-plugins-2.6.0/tools/abicollab/backends/xp/lock.h	2008-03-29 01:53:52.000000000 +0100
34b6398
@@ -0,0 +1,94 @@
34b6398
+/* Copyright (C) 2008 by Marc Maurer <uwog@uwog.net>
34b6398
+ *
34b6398
+ * This program is free software; you can redistribute it and/or
34b6398
+ * modify it under the terms of the GNU General Public License
34b6398
+ * as published by the Free Software Foundation; either version 2
34b6398
+ * of the License, or (at your option) any later version.
34b6398
+ *
34b6398
+ * This program is distributed in the hope that it will be useful,
34b6398
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
34b6398
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
34b6398
+ * GNU General Public License for more details.
34b6398
+ *
34b6398
+ * You should have received a copy of the GNU General Public License
34b6398
+ * along with this program; if not, write to the Free Software
34b6398
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
34b6398
+ * 02111-1307, USA.
34b6398
+ */
34b6398
+
34b6398
+#ifndef WIN32
34b6398
+#include <pthread.h>
34b6398
+#endif
34b6398
+
34b6398
+namespace abicollab
34b6398
+{
34b6398
+
34b6398
+class scoped_lock;
34b6398
+
34b6398
+class mutex
34b6398
+{
34b6398
+friend class scoped_lock;
34b6398
+
34b6398
+public:
34b6398
+	mutex()
34b6398
+	{
34b6398
+#ifdef WIN32
34b6398
+		repr = CreateMutex(0, FALSE, 0);
34b6398
+#else
34b6398
+		pthread_mutex_init(&repr, NULL);
34b6398
+#endif
34b6398
+	}
34b6398
+
34b6398
+	~mutex()
34b6398
+	{
34b6398
+#ifdef WIN32
34b6398
+		CloseHandle(repr);
34b6398
+#else
34b6398
+		pthread_mutex_destroy(&repr);
34b6398
+#endif
34b6398
+	}
34b6398
+
34b6398
+private:
34b6398
+	// we are noncopyable
34b6398
+	mutex( const mutex& );
34b6398
+	const mutex& operator=( const mutex& );
34b6398
+
34b6398
+#ifdef WIN32
34b6398
+	HANDLE repr;
34b6398
+#else
34b6398
+	pthread_mutex_t repr;
34b6398
+#endif
34b6398
+};
34b6398
+
34b6398
+class scoped_lock
34b6398
+{
34b6398
+public:
34b6398
+	scoped_lock(mutex& mutex)
34b6398
+		: m_mutex(mutex)
34b6398
+	{
34b6398
+#ifdef WIN32
34b6398
+		WaitForSingleObject(m_mutex.repr, INFINITE);
34b6398
+#else
34b6398
+		pthread_mutex_lock(&m_mutex.repr);
34b6398
+#endif
34b6398
+	}
34b6398
+
34b6398
+	~scoped_lock()
34b6398
+	{
34b6398
+#ifdef WIN32
34b6398
+		ReleaseMutex(m_mutex.repr);
34b6398
+#else
34b6398
+		pthread_mutex_unlock(&m_mutex.repr);
34b6398
+#endif
34b6398
+	}
34b6398
+
34b6398
+private:
34b6398
+	// we are noncopyable
34b6398
+	scoped_lock( const scoped_lock& );
34b6398
+	const scoped_lock& operator=( const scoped_lock& );
34b6398
+
34b6398
+	mutex& m_mutex;
34b6398
+};
34b6398
+
34b6398
+}
34b6398
+
34b6398
diff -N -u -r abiword-plugins-2.6.0.orig/tools/abicollab/plugin.m4 abiword-plugins-2.6.0/tools/abicollab/plugin.m4
34b6398
--- abiword-plugins-2.6.0.orig/tools/abicollab/plugin.m4	2008-03-18 23:18:08.000000000 +0100
34b6398
+++ abiword-plugins-2.6.0/tools/abicollab/plugin.m4	2008-03-29 01:53:52.000000000 +0100
34b6398
@@ -75,7 +75,6 @@
34b6398
 
34b6398
 # check for various boost libs
34b6398
 AX_BOOST_BASE([1.33.1])
34b6398
-AX_BOOST_THREAD
34b6398
 
34b6398
 # check for asio
34b6398
 AC_LANG_PUSH(C++)
34b6398
@@ -134,7 +133,7 @@
34b6398
 ])
34b6398
 if test "x$abicollab_handler_tcp" = "xyes" ; then
34b6398
 	ABICOLLAB_TCP_CPPFLAGS="-DABICOLLAB_HANDLER_TCP $ABICOLLAB_ASIO_CPPFLAGS"
34b6398
-	ABICOLLAB_TCP_LIBS="$BOOST_THREAD_LIB"
34b6398
+	ABICOLLAB_TCP_LIBS="-lpthread"
34b6398
 fi
34b6398
 CPPFLAGS="$_abi_cppflags_save"
34b6398
 LDFLAGS="$_abi_ldflags_save"
34b6398
@@ -193,7 +192,7 @@
34b6398
 ])
34b6398
 if test "x$abicollab_handler_service" = "xyes" ; then
34b6398
 	ABICOLLAB_SERVICE_CPPFLAGS="-DABICOLLAB_HANDLER_SERVICE $ABICOLLAB_ASIO_CPPFLAGS"
34b6398
-	ABICOLLAB_SERVICE_LIBS="$BOOST_THREAD_LIB"
34b6398
+	ABICOLLAB_SERVICE_LIBS="-lpthread"
34b6398
 fi
34b6398
 AC_SUBST(ABICOLLAB_SERVICE_CPPFLAGS)
34b6398
 AC_SUBST(ABICOLLAB_SERVICE_LIBS)