]> granicus.if.org Git - icinga2/commitdiff
Build fix for Solaris.
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 13 Aug 2012 11:06:43 +0000 (13:06 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 13 Aug 2012 11:06:43 +0000 (13:06 +0200)
13 files changed:
base/event.cpp
base/event.h
base/i2-base.h
base/object.cpp
base/object.h
base/process.cpp
base/socket.cpp
base/socket.h
base/tcpclient.cpp
base/tcpclient.h
base/threadpool.cpp
base/threadpool.h
base/tlsclient.cpp

index e68bc5e50242faa7a4d02a817148e11986599dbb..d72b184ae6dee7226d84e1367bc6ce9673c9a368 100644 (file)
@@ -23,7 +23,7 @@ using namespace icinga;
 
 vector<Event> Event::m_Events;
 condition_variable Event::m_EventAvailable;
-mutex Event::m_Mutex;
+boost::mutex Event::m_Mutex;
 
 Event::Event(const Event::Callback& callback)
        : m_Callback(callback)
@@ -34,7 +34,7 @@ void Event::ProcessEvents(const system_time& wait_until)
        vector<Event> events;
 
        {
-               mutex::scoped_lock lock(m_Mutex);
+               boost::mutex::scoped_lock lock(m_Mutex);
 
                while (m_Events.empty()) {
                        if (!m_EventAvailable.timed_wait(lock, wait_until))
@@ -69,7 +69,7 @@ void Event::Post(const Event::Callback& callback)
        Event ev(callback);
 
        {
-               mutex::scoped_lock lock(m_Mutex);
+               boost::mutex::scoped_lock lock(m_Mutex);
                m_Events.push_back(ev);
                m_EventAvailable.notify_all();
        }
index 79771186671da053dfe533a4d7b4b81509e8cb88..06ebe1f32410b52aab5b470790fc7db4caff602c 100644 (file)
@@ -38,7 +38,7 @@ private:
 
        static vector<Event> m_Events;
        static condition_variable m_EventAvailable;
-       static mutex m_Mutex;
+       static boost::mutex m_Mutex;
 };
 
 }
index e8731b1b1cb1bba5dfcaa2fdb90c06d896775d09..cf0c87212fd36a2fa8f2f515f4faaced6f6379a8 100644 (file)
@@ -137,7 +137,6 @@ using boost::static_pointer_cast;
 using boost::function;
 using boost::thread;
 using boost::thread_group;
-using boost::mutex;
 using boost::condition_variable;
 using boost::system_time;
 using boost::tie;
index 20d9b2c784e55228f33f54fb6fab883d40b84e79..846912f6a4ee50e222e228cc83093f59306714fe 100644 (file)
@@ -21,7 +21,7 @@
 
 using namespace icinga;
 
-mutex Object::m_Mutex;
+boost::mutex Object::m_Mutex;
 vector<Object::Ptr> Object::m_HeldObjects;
 #ifdef _DEBUG
 set<Object *> Object::m_AliveObjects;
@@ -33,7 +33,7 @@ set<Object *> Object::m_AliveObjects;
 Object::Object(void)
 {
 #ifdef _DEBUG
-       mutex::scoped_lock lock(m_Mutex);
+       boost::mutex::scoped_lock lock(m_Mutex);
        m_AliveObjects.insert(this);
 #endif /* _DEBUG */
 }
@@ -44,7 +44,7 @@ Object::Object(void)
 Object::~Object(void)
 {
 #ifdef _DEBUG
-       mutex::scoped_lock lock(m_Mutex);
+       boost::mutex::scoped_lock lock(m_Mutex);
        m_AliveObjects.erase(this);
 #endif /* _DEBUG */
 }
@@ -56,7 +56,7 @@ Object::~Object(void)
  */
 void Object::Hold(void)
 {
-       mutex::scoped_lock lock(m_Mutex);
+       boost::mutex::scoped_lock lock(m_Mutex);
        m_HeldObjects.push_back(GetSelf());
 }
 
@@ -65,7 +65,7 @@ void Object::Hold(void)
  */
 void Object::ClearHeldObjects(void)
 {
-       mutex::scoped_lock lock(m_Mutex);
+       boost::mutex::scoped_lock lock(m_Mutex);
        m_HeldObjects.clear();
 }
 
@@ -77,7 +77,7 @@ Object::SharedPtrHolder Object::GetSelf(void)
 #ifdef _DEBUG
 int Object::GetAliveObjects(void)
 {
-       mutex::scoped_lock lock(m_Mutex);
+       boost::mutex::scoped_lock lock(m_Mutex);
        return m_AliveObjects.size();
 }
 
@@ -88,7 +88,7 @@ void Object::PrintMemoryProfile(void)
        ofstream dictfp("dictionaries.dump.tmp");
 
        {
-               mutex::scoped_lock lock(m_Mutex);
+               boost::mutex::scoped_lock lock(m_Mutex);
                set<Object *>::iterator it;
                BOOST_FOREACH(Object *obj, m_AliveObjects) {
                        pair<map<String, int>::iterator, bool> tt;
index 6398938e25e03a8508f836a51fcd2c9717d563a5..c58a877cf5301ceef7b16206372421a7807aea78 100644 (file)
@@ -88,7 +88,7 @@ private:
        Object(const Object& other);
        Object& operator=(const Object& rhs);
 
-       static mutex m_Mutex;
+       static boost::mutex m_Mutex;
        static vector<Object::Ptr> m_HeldObjects;
 #ifdef _DEBUG
        static set<Object *> m_AliveObjects;
index 97ac045411b1714e57de95b70fc3c8e0038d5cc9..e8abd61f23ace0d7e07022f92672d82e51d06418 100644 (file)
@@ -43,14 +43,14 @@ Process::Process(const String& command)
 
 void Process::Run(void)
 {
-       mutex::scoped_lock lock(m_Mutex);
+       boost::mutex::scoped_lock lock(m_Mutex);
        m_Tasks.push_back(GetSelf());
        m_TasksCV.notify_all();
 }
 
 void Process::WorkerThreadProc(void)
 {
-       mutex::scoped_lock lock(m_Mutex);
+       boost::mutex::scoped_lock lock(m_Mutex);
 
        map<int, Process::Ptr> tasks;
 
index f1a274ccf97394af36284a2cd59ad119fde59851..db8737fcca4c0cf5802383ba5d5997fbacb23746 100644 (file)
@@ -33,7 +33,7 @@ Socket::Socket(void)
  */
 Socket::~Socket(void)
 {
-       mutex::scoped_lock lock(m_SocketMutex);
+       boost::mutex::scoped_lock lock(m_SocketMutex);
        CloseInternal(true);
 }
 
@@ -90,7 +90,7 @@ SOCKET Socket::GetFD(void) const
  */
 void Socket::Close(void)
 {
-       mutex::scoped_lock lock(m_SocketMutex);
+       boost::mutex::scoped_lock lock(m_SocketMutex);
 
        CloseInternal(false);
 }
@@ -209,7 +209,7 @@ String Socket::GetAddressFromSockaddr(sockaddr *address, socklen_t len)
  */
 String Socket::GetClientAddress(void)
 {
-       mutex::scoped_lock lock(m_SocketMutex);
+       boost::mutex::scoped_lock lock(m_SocketMutex);
 
        sockaddr_storage sin;
        socklen_t len = sizeof(sin);
@@ -227,7 +227,7 @@ String Socket::GetClientAddress(void)
  */
 String Socket::GetPeerAddress(void)
 {
-       mutex::scoped_lock lock(m_SocketMutex);
+       boost::mutex::scoped_lock lock(m_SocketMutex);
 
        sockaddr_storage sin;
        socklen_t len = sizeof(sin);
@@ -258,7 +258,7 @@ SocketException::SocketException(const String& message, int errorCode)
 
 void Socket::ReadThreadProc(void)
 {
-       mutex::scoped_lock lock(m_SocketMutex);
+       boost::mutex::scoped_lock lock(m_SocketMutex);
 
        for (;;) {
                fd_set readfds, exceptfds;
@@ -312,7 +312,7 @@ void Socket::ReadThreadProc(void)
 
 void Socket::WriteThreadProc(void)
 {
-       mutex::scoped_lock lock(m_SocketMutex);
+       boost::mutex::scoped_lock lock(m_SocketMutex);
 
        for (;;) {
                fd_set writefds;
index fbf394004509eefa3b674f0bb3194f2f1627627f..1777f2f152e2576b821439c6c562c767a1489e24 100644 (file)
@@ -68,7 +68,7 @@ protected:
 
        virtual void CloseInternal(bool from_dtor);
 
-       mutable mutex m_SocketMutex;
+       mutable boost::mutex m_SocketMutex;
 
 private:
        SOCKET m_FD; /**< The socket descriptor. */
index 317897fd2b0e52ef69dbb9b18075e8f02b6ab8c8..6680763d7c9b567b089b3ac3356555daaed75d47 100644 (file)
@@ -115,7 +115,7 @@ void TcpClient::HandleWritable(void)
 
        for (;;) {
                {
-                       mutex::scoped_lock lock(m_QueueMutex);
+                       boost::mutex::scoped_lock lock(m_QueueMutex);
 
                        count = m_SendQueue->GetAvailableBytes();
 
@@ -134,7 +134,7 @@ void TcpClient::HandleWritable(void)
                        throw_exception(SocketException("send() failed", GetError()));
 
                {
-                       mutex::scoped_lock lock(m_QueueMutex);
+                       boost::mutex::scoped_lock lock(m_QueueMutex);
                        m_SendQueue->Read(NULL, rc);
                }
        }
@@ -145,7 +145,7 @@ void TcpClient::HandleWritable(void)
  */
 size_t TcpClient::GetAvailableBytes(void) const
 {
-       mutex::scoped_lock lock(m_QueueMutex);
+       boost::mutex::scoped_lock lock(m_QueueMutex);
 
        return m_RecvQueue->GetAvailableBytes();
 }
@@ -155,7 +155,7 @@ size_t TcpClient::GetAvailableBytes(void) const
  */
 void TcpClient::Peek(void *buffer, size_t count)
 {
-       mutex::scoped_lock lock(m_QueueMutex);
+       boost::mutex::scoped_lock lock(m_QueueMutex);
 
        m_RecvQueue->Peek(buffer, count);
 }
@@ -165,7 +165,7 @@ void TcpClient::Peek(void *buffer, size_t count)
  */
 void TcpClient::Read(void *buffer, size_t count)
 {
-       mutex::scoped_lock lock(m_QueueMutex);
+       boost::mutex::scoped_lock lock(m_QueueMutex);
 
        m_RecvQueue->Read(buffer, count);
 }
@@ -175,7 +175,7 @@ void TcpClient::Read(void *buffer, size_t count)
  */
 void TcpClient::Write(const void *buffer, size_t count)
 {
-       mutex::scoped_lock lock(m_QueueMutex);
+       boost::mutex::scoped_lock lock(m_QueueMutex);
 
        m_SendQueue->Write(buffer, count);
 }
@@ -202,7 +202,7 @@ void TcpClient::HandleReadable(void)
                        throw_exception(SocketException("recv() failed", GetError()));
 
                {
-                       mutex::scoped_lock lock(m_QueueMutex);
+                       boost::mutex::scoped_lock lock(m_QueueMutex);
 
                        m_RecvQueue->Write(data, rc);
                }
@@ -229,7 +229,7 @@ bool TcpClient::WantsToRead(void) const
 bool TcpClient::WantsToWrite(void) const
 {
        {
-               mutex::scoped_lock lock(m_QueueMutex);
+               boost::mutex::scoped_lock lock(m_QueueMutex);
 
                if (m_SendQueue->GetAvailableBytes() > 0)
                        return true;
index 76076e494117c763c5397511754acd7463b1734a..64d33fef9ba2ecf1310a37bc886a94462a4161a4 100644 (file)
@@ -68,7 +68,7 @@ protected:
        virtual void HandleReadable(void);
        virtual void HandleWritable(void);
 
-       mutable mutex m_QueueMutex;
+       mutable boost::mutex m_QueueMutex;
        FIFO::Ptr m_SendQueue;
        FIFO::Ptr m_RecvQueue;
 
index dbc388df58e3dc70cc100ae67367d15ec2b92760..b53f4aa5549ba69151f4d53063117eb5682f5dba 100644 (file)
@@ -31,7 +31,7 @@ ThreadPool::ThreadPool(long numThreads)
 ThreadPool::~ThreadPool(void)
 {
        {
-               mutex::scoped_lock lock(m_Lock);
+               boost::mutex::scoped_lock lock(m_Lock);
 
                m_Tasks.clear();
 
@@ -46,7 +46,7 @@ ThreadPool::~ThreadPool(void)
 void ThreadPool::EnqueueTasks(list<ThreadPoolTask::Ptr>& tasks)
 {
        {
-               mutex::scoped_lock lock(m_Lock);
+               boost::mutex::scoped_lock lock(m_Lock);
                m_Tasks.splice(m_Tasks.end(), tasks, tasks.begin(), tasks.end());
        }
 
@@ -56,7 +56,7 @@ void ThreadPool::EnqueueTasks(list<ThreadPoolTask::Ptr>& tasks)
 void ThreadPool::EnqueueTask(const ThreadPoolTask::Ptr& task)
 {
        {
-               mutex::scoped_lock lock(m_Lock);
+               boost::mutex::scoped_lock lock(m_Lock);
                m_Tasks.push_back(task);
        }
 
@@ -66,7 +66,7 @@ void ThreadPool::EnqueueTask(const ThreadPoolTask::Ptr& task)
 
 ThreadPoolTask::Ptr ThreadPool::DequeueTask(void)
 {
-       mutex::scoped_lock lock(m_Lock);
+       boost::mutex::scoped_lock lock(m_Lock);
 
        while (m_Tasks.empty()) {
                if (!m_Alive)
@@ -83,7 +83,7 @@ ThreadPoolTask::Ptr ThreadPool::DequeueTask(void)
 
 void ThreadPool::WaitForTasks(void)
 {
-       mutex::scoped_lock lock(m_Lock);
+       boost::mutex::scoped_lock lock(m_Lock);
 
        /* wait for all pending tasks */
        while (!m_Tasks.empty())
index 30eefdf300fe36c32d9917bc4b832335ddf83989..7bb3b48c4152674342dbf7a4a128ea84a8b8c3a0 100644 (file)
@@ -47,7 +47,7 @@ public:
        void WaitForTasks(void);
 
 private:
-       mutable mutex m_Lock;
+       mutable boost::mutex m_Lock;
        condition_variable m_CV;
 
        list<ThreadPoolTask::Ptr> m_Tasks;
index d69b3e34504b0ab7f3625f35f8882a24bd6043a8..1f4f2a27049069c07a3ed36e02c7f43cacb39ada 100644 (file)
@@ -80,7 +80,7 @@ void TlsClient::Start(void)
  */
 shared_ptr<X509> TlsClient::GetClientCertificate(void) const
 {
-       mutex::scoped_lock lock(m_SocketMutex);
+       boost::mutex::scoped_lock lock(m_SocketMutex);
 
        return shared_ptr<X509>(SSL_get_certificate(m_SSL.get()), &Utility::NullDeleter);
 }
@@ -92,7 +92,7 @@ shared_ptr<X509> TlsClient::GetClientCertificate(void) const
  */
 shared_ptr<X509> TlsClient::GetPeerCertificate(void) const
 {
-       mutex::scoped_lock lock(m_SocketMutex);
+       boost::mutex::scoped_lock lock(m_SocketMutex);
 
        return shared_ptr<X509>(SSL_get_peer_certificate(m_SSL.get()), X509_free);
 }
@@ -137,7 +137,7 @@ void TlsClient::HandleReadable(void)
                }
 
                if (IsConnected()) {
-                       mutex::scoped_lock lock(m_QueueMutex);
+                       boost::mutex::scoped_lock lock(m_QueueMutex);
 
                        m_RecvQueue->Write(data, rc);
                }
@@ -163,7 +163,7 @@ void TlsClient::HandleWritable(void)
 
                if (IsConnected()) {
                        {
-                               mutex::scoped_lock lock(m_QueueMutex);
+                               boost::mutex::scoped_lock lock(m_QueueMutex);
 
                                count = m_SendQueue->GetAvailableBytes();
 
@@ -203,7 +203,7 @@ void TlsClient::HandleWritable(void)
                }
 
                if (IsConnected()) {
-                       mutex::scoped_lock lock(m_QueueMutex);
+                       boost::mutex::scoped_lock lock(m_QueueMutex);
 
                        m_SendQueue->Read(NULL, rc);
                }