diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-03-08 14:10:45 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-03-08 14:11:56 +0100 |
commit | d5cb0636dc902f069307a44181ce5bb14932c0f9 (patch) | |
tree | e397ea2180aecc30250fe94d1eb4dc69bc484cc9 /sal | |
parent | c6e83ea051054c59abb685ad4258ac0b74e119c4 (diff) |
In osl::Thread::create, do not access members after starting the thread
...as the Thread may already have been destroyed by that time.
Also, no need to programmatically check fro programming errors when they
have already been addressed by assert.
Diffstat (limited to 'sal')
-rw-r--r-- | sal/inc/osl/thread.hxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sal/inc/osl/thread.hxx b/sal/inc/osl/thread.hxx index 0bade3b06c86..ddb9d918e96e 100644 --- a/sal/inc/osl/thread.hxx +++ b/sal/inc/osl/thread.hxx @@ -81,14 +81,13 @@ public: sal_Bool SAL_CALL create() { assert(m_hThread == 0); // only one running thread per instance - if (m_hThread) - return sal_False; - m_hThread = osl_createSuspendedThread( threadFunc, (void*)this); - if ( m_hThread ) - osl_resumeThread(m_hThread); - - return m_hThread != 0; + if (m_hThread == 0) + { + return false; + } + osl_resumeThread(m_hThread); + return true; } sal_Bool SAL_CALL createSuspended() |