Add AIThreadID - Cleanup of apr_os_thread* related code.

Apart from just really cleaning things up and moving
everything into one class regarding thread IDs (ie,
is_main_thread(), comparing ID's etc), this also
fixes an obscure bug where LL was casting thread ID's
to U32 and then compared those to find out if it
the same thread. It's theoretically possible that
such fails on a 64bit OS.

By generalizing the interface, I adopted the use
of a thread-local cache for the current thread ID
as used by LLMutex et al, so now all code benefits
from that. The idea was even extended to now also
be used for is_main_thread() tests and even resetting
a thread ID to the ID of the current thread.
This commit is contained in:
Aleric Inglewood
2012-08-09 06:30:31 +02:00
parent f94f458922
commit 37c8ea54eb
13 changed files with 246 additions and 110 deletions

View File

@@ -308,8 +308,4 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG;
Such computation is done iff the message will be logged.
*/
#ifdef SHOW_ASSERT
extern LL_COMMON_API bool is_main_thread();
#endif
#endif // LL_LLERROR_H