summaryrefslogtreecommitdiff
path: root/sal/inc/osl
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2011-01-28 11:58:57 +0100
committersb <sb@openoffice.org>2011-01-28 11:58:57 +0100
commit6875a4b2aad35aaa07906dfd7386cc519d0fd933 (patch)
tree6872f34e5504d5a177101b4c37c2cd1872a5bc2b /sal/inc/osl
parent138ab06ecc2c288963dac707ebc94b69ce92f39d (diff)
sb138: #i115619# osl_setThreadName
Diffstat (limited to 'sal/inc/osl')
-rw-r--r--sal/inc/osl/thread.h12
-rw-r--r--sal/inc/osl/thread.hxx3
2 files changed, 15 insertions, 0 deletions
diff --git a/sal/inc/osl/thread.h b/sal/inc/osl/thread.h
index 16860644d7a0..79db10f58097 100644
--- a/sal/inc/osl/thread.h
+++ b/sal/inc/osl/thread.h
@@ -159,6 +159,18 @@ sal_Bool SAL_CALL osl_scheduleThread(oslThread Thread);
*/
void SAL_CALL osl_yieldThread(void);
+/** Attempts to set the name of the current thread.
+
+ 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.
+
+ @param name the name of the thread; must not be null; on Linux, only the
+ first 16 characters are used
+*/
+void SAL_CALL osl_setThreadName(char const * name);
+
/* Callback when data stored in a thread key is no longer needed */
typedef void (SAL_CALL *oslThreadKeyCallbackFunction)(void *);
diff --git a/sal/inc/osl/thread.hxx b/sal/inc/osl/thread.hxx
index 51fe059d2210..c3ca49926456 100644
--- a/sal/inc/osl/thread.hxx
+++ b/sal/inc/osl/thread.hxx
@@ -150,6 +150,9 @@ public:
osl_yieldThread();
}
+ static inline void setName(char const * name) throw () {
+ osl_setThreadName(name);
+ }
virtual sal_Bool SAL_CALL schedule()
{