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

@@ -15,8 +15,9 @@ include_directories(
)
set(llcommon_SOURCE_FILES
aiframetimer.cpp
imageids.cpp
aiframetimer.cpp
aithreadid.cpp
imageids.cpp
indra_constants.cpp
llallocator.cpp
llallocator_heap_profile.cpp
@@ -24,7 +25,7 @@ set(llcommon_SOURCE_FILES
llapr.cpp
llaprpool.cpp
llassettype.cpp
llavatarname.cpp
llavatarname.cpp
llbase32.cpp
llbase64.cpp
llcommon.cpp
@@ -103,6 +104,7 @@ set(llcommon_HEADER_FILES
CMakeLists.txt
aiframetimer.h
aithreadid.h
aithreadsafe.h
bitpack.h
ctype_workaround.h