summaryrefslogtreecommitdiff
path: root/cpp/src/IceUtil/ThreadException.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-09-22 15:57:38 +0000
committerMarc Laukien <marc@zeroc.com>2002-09-22 15:57:38 +0000
commitdff71be00b07d293b318fede3167b3c48f2270b8 (patch)
tree35e0236914020cd396dca7675119fb3c435693ac /cpp/src/IceUtil/ThreadException.cpp
parentthread fixes (diff)
downloadice-dff71be00b07d293b318fede3167b3c48f2270b8.tar.bz2
ice-dff71be00b07d293b318fede3167b3c48f2270b8.tar.xz
ice-dff71be00b07d293b318fede3167b3c48f2270b8.zip
dos2unix
Diffstat (limited to 'cpp/src/IceUtil/ThreadException.cpp')
-rw-r--r--cpp/src/IceUtil/ThreadException.cpp200
1 files changed, 100 insertions, 100 deletions
diff --git a/cpp/src/IceUtil/ThreadException.cpp b/cpp/src/IceUtil/ThreadException.cpp
index f0e9acea3b9..88c3413c9fd 100644
--- a/cpp/src/IceUtil/ThreadException.cpp
+++ b/cpp/src/IceUtil/ThreadException.cpp
@@ -1,100 +1,100 @@
-// **********************************************************************
-//
-// Copyright (c) 2001
-// Mutable Realms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#include <IceUtil/ThreadException.h>
-
-using namespace std;
-
-IceUtil::ThreadSyscallException::ThreadSyscallException(const char* file, int line) :
- Exception(file, line),
-#ifdef _WIN32
- _error(GetLastError())
-#else
- _error(errno)
-#endif
-{
-}
-
-string
-IceUtil::ThreadSyscallException::ice_name() const
-{
- return "IceUtil::ThreadSyscallException";
-}
-
-void
-IceUtil::ThreadSyscallException::ice_print(ostream& os) const
-{
- Exception::ice_print(os);
- if(_error != 0)
- {
- os << ":\nthread syscall exception: ";
-#ifdef _WIN32
- LPVOID lpMsgBuf = 0;
- DWORD ok = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- _error,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
- (LPTSTR)&lpMsgBuf,
- 0,
- NULL);
-
- if(ok)
- {
- LPCTSTR msg = (LPCTSTR)lpMsgBuf;
- assert(msg && strlen(msg) > 0);
- os << msg;
- LocalFree(lpMsgBuf);
- }
- else
- {
- os << "unknown thread error";
- }
-#else
- os << strerror(_error);
-#endif
- }
-}
-
-IceUtil::Exception*
-IceUtil::ThreadSyscallException::ice_clone() const
-{
- return new ThreadSyscallException(*this);
-}
-
-void
-IceUtil::ThreadSyscallException::ice_throw() const
-{
- throw *this;
-}
-
-IceUtil::ThreadLockedException::ThreadLockedException(const char* file, int line) :
- Exception(file, line)
-{
-}
-
-string
-IceUtil::ThreadLockedException::ice_name() const
-{
- return "IceUtil::ThreadLockedException";
-}
-
-IceUtil::Exception*
-IceUtil::ThreadLockedException::ice_clone() const
-{
- return new ThreadLockedException(*this);
-}
-
-void
-IceUtil::ThreadLockedException::ice_throw() const
-{
- throw *this;
-}
+// **********************************************************************
+//
+// Copyright (c) 2001
+// Mutable Realms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#include <IceUtil/ThreadException.h>
+
+using namespace std;
+
+IceUtil::ThreadSyscallException::ThreadSyscallException(const char* file, int line) :
+ Exception(file, line),
+#ifdef _WIN32
+ _error(GetLastError())
+#else
+ _error(errno)
+#endif
+{
+}
+
+string
+IceUtil::ThreadSyscallException::ice_name() const
+{
+ return "IceUtil::ThreadSyscallException";
+}
+
+void
+IceUtil::ThreadSyscallException::ice_print(ostream& os) const
+{
+ Exception::ice_print(os);
+ if(_error != 0)
+ {
+ os << ":\nthread syscall exception: ";
+#ifdef _WIN32
+ LPVOID lpMsgBuf = 0;
+ DWORD ok = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ _error,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR)&lpMsgBuf,
+ 0,
+ NULL);
+
+ if(ok)
+ {
+ LPCTSTR msg = (LPCTSTR)lpMsgBuf;
+ assert(msg && strlen(msg) > 0);
+ os << msg;
+ LocalFree(lpMsgBuf);
+ }
+ else
+ {
+ os << "unknown thread error";
+ }
+#else
+ os << strerror(_error);
+#endif
+ }
+}
+
+IceUtil::Exception*
+IceUtil::ThreadSyscallException::ice_clone() const
+{
+ return new ThreadSyscallException(*this);
+}
+
+void
+IceUtil::ThreadSyscallException::ice_throw() const
+{
+ throw *this;
+}
+
+IceUtil::ThreadLockedException::ThreadLockedException(const char* file, int line) :
+ Exception(file, line)
+{
+}
+
+string
+IceUtil::ThreadLockedException::ice_name() const
+{
+ return "IceUtil::ThreadLockedException";
+}
+
+IceUtil::Exception*
+IceUtil::ThreadLockedException::ice_clone() const
+{
+ return new ThreadLockedException(*this);
+}
+
+void
+IceUtil::ThreadLockedException::ice_throw() const
+{
+ throw *this;
+}