gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r10881: Use a pointer for the thread


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r10881: Use a pointer for the thread, as some versions of boost don't have
Date: Mon, 18 May 2009 16:27:16 +0200
User-agent: Bazaar (1.13.1)

------------------------------------------------------------
revno: 10881
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Mon 2009-05-18 16:27:16 +0200
message:
  Use a pointer for the thread, as some versions of boost don't have
  copyable threads.
modified:
  libcore/asobj/XMLSocket_as.cpp
=== modified file 'libcore/asobj/XMLSocket_as.cpp'
--- a/libcore/asobj/XMLSocket_as.cpp    2009-05-18 08:52:25 +0000
+++ b/libcore/asobj/XMLSocket_as.cpp    2009-05-18 14:27:16 +0000
@@ -36,6 +36,7 @@
 
 #include <boost/thread.hpp>
 #include <boost/scoped_array.hpp>
+#include <boost/scoped_ptr.hpp>
 #include <string>
 
 #undef GNASH_XMLSOCKET_DEBUG
@@ -72,8 +73,8 @@
 
     /// Initiate a connection.
     void connect(const std::string& host, boost::uint16_t port) {
-        _start = boost::thread(
-            boost::bind(&SocketConnection::makeConnection, this, host, port));
+        _start.reset(new boost::thread(
+            boost::bind(&SocketConnection::makeConnection, this, host, port)));
     }
 
     /// The state of the connection.
@@ -188,7 +189,7 @@
     //
     /// This also cancels any connection attempt in progress.
     void close() {
-        _start.join();
+        if (_start) _start.reset();
         _socket.closeNet();
         
         // Reset for next connection.
@@ -211,7 +212,7 @@
 
     std::string _remainder;
 
-    boost::thread _start;
+    boost::scoped_ptr<boost::thread> _start;
 
 };
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]