Frank Schönheit - Sun Microsystems Germany wrote:
Hi Stephan,
Re the check in the dor: The osl_destroyThread documentation says "If
Thread is NULL, the function won't do anything." Why not rely on this?
Because sometimes a thread object might be created, but never actually used?
I guess we are talking past each other here. My point was that
osl_destroyThread is guaranteed by its documentation to noop for NULL
(so should most probably not contain some OSL_ASSERT(!NULL)), so there
is no need to wrap the call osl_destroyThread(m_hThread) in
if(m_hThread!=NULL).
Re the other checks: Is it useful to have those functions silently noop
for a non-created thread? I would guess that any code that relies on
those newly introduced checks is already in error, and should rather be
exposed and fixed rather than hidden. (Also, getIdentifier for
m_hTread==NULL confusingly returns the id of the current thread, at
least in the osl/unx branch.)
I would agree for everything but the dtor. Finally, if someone calls
Thread::resume (or something like this) before |create|, then this is
clearly a bug. But if you call the dtor before calling create (vulgo:
You decide to not use the thread at all), this *might* be valid.
So we agree completely (modulo any misunderstandings). :)
-Stephan
At least this would be my careful argueing, as the one who ages ago
introduced the code which actually destroys Threads without using them ...
Ciao
Frank
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]