diff options
author | sb <sb@openoffice.org> | 2011-01-31 13:32:40 +0100 |
---|---|---|
committer | sb <sb@openoffice.org> | 2011-01-31 13:32:40 +0100 |
commit | 6727dc5d9414e77975b9fd765993c6e207f872f3 (patch) | |
tree | 82a88625d03e0a2a78bd3e4267f0fe6706cdebc1 /sal | |
parent | f78c98fc9c62094aa4eff5494efc38f15a0fc1ec (diff) |
sb138: #i115619# fix for MinGW
Diffstat (limited to 'sal')
-rw-r--r-- | sal/inc/osl/thread.h | 4 | ||||
-rwxr-xr-x | sal/osl/w32/thread.c | 4 | ||||
-rwxr-xr-x | sal/qa/osl/setthreadname/test-setthreadname.cxx | 3 |
3 files changed, 8 insertions, 3 deletions
diff --git a/sal/inc/osl/thread.h b/sal/inc/osl/thread.h index 79db10f58097..4c53b001fcd6 100644 --- a/sal/inc/osl/thread.h +++ b/sal/inc/osl/thread.h @@ -163,8 +163,8 @@ void SAL_CALL osl_yieldThread(void); The name of a thread is usually evaluated for debugging purposes. Not all platforms support this. On Linux, a set thread name can be observed with - "ps -L". On Windows, a thread name set while a debugger is attached can be - observed within the debugger. + "ps -L". On Windows with the Microsoft compiler, a thread name set while a + debugger is attached can be observed within the debugger. @param name the name of the thread; must not be null; on Linux, only the first 16 characters are used diff --git a/sal/osl/w32/thread.c b/sal/osl/w32/thread.c index 7506c078c536..8d85c8867b2d 100755 --- a/sal/osl/w32/thread.c +++ b/sal/osl/w32/thread.c @@ -395,6 +395,7 @@ void SAL_CALL osl_yieldThread(void) } void SAL_CALL osl_setThreadName(char const * name) { +#ifdef _MSC_VER /* See <http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx>: */ #pragma pack(push, 8) struct { @@ -413,6 +414,9 @@ void SAL_CALL osl_setThreadName(char const * name) { 0x406D1388, 0, sizeof info / sizeof (ULONG_PTR), (ULONG_PTR *) &info); } __except (EXCEPTION_EXECUTE_HANDLER) {} +#else + (void) name; +#endif } typedef struct _TLS diff --git a/sal/qa/osl/setthreadname/test-setthreadname.cxx b/sal/qa/osl/setthreadname/test-setthreadname.cxx index b5c7e02cfaa7..0f0f618395a8 100755 --- a/sal/qa/osl/setthreadname/test-setthreadname.cxx +++ b/sal/qa/osl/setthreadname/test-setthreadname.cxx @@ -58,7 +58,8 @@ void TestThread::run() { setName("TestThread"); if (std::getenv("URE_TEST_SETTHREADNAME") != 0) { // On Linux, the thread name can now be observed with "ps -L"; on - // Windows, the thread name can now be observed in a debugger. + // Windows with the Microsoft compiler, the thread name can now be + // observed in a debugger. std::cout << "stop: "; std::cin.ignore(std::numeric_limits< int >::max(), '\n'); } |