Commit Graph

13 Commits (a831237e29c650146b6870b568feddcda310ab29)

Author SHA1 Message Date
Alexander Gavriliuk e4a1feb830 SL-20743 Use LLMutex in LLImageBase for internal data thread-safety (update) 2024-01-07 18:59:43 +01:00
Alexander Gavriliuk 74c8b028d4 SL-20743 Use LLMutex in LLImageBase for internal data thread-safety 2023-12-21 19:12:52 +01:00
Ptolemy b504c69255 SL-16606: Add profiler category THREAD 2022-01-14 11:50:21 -08:00
Dave Parks 675514bdb3 SL-16093 Don't force the console window to be open on developer builds because it causes frame stalls while logging. 2021-09-27 23:56:06 +00:00
Nat Goodspeed 5e7df752a6 DRTVWR-494: Use std:🧵:id for LLThread::currentID().
LLThread::currentID() used to return a U32, a distinct unsigned value
incremented by explicitly constructing LLThread or by calling LLThread::
registerThreadID() early in a thread launched by other means. The latter
imposed an unobvious requirement on new code based on std::thread. Using
std:🧵:id instead delegates to the compiler/library the problem of
distinguishing threads launched by any means.

Change lots of explicit U32 declarations. Introduce LLThread::id_t typedef to
avoid having to run around fixing uses again if we later revisit this decision.

LLMutex, which stores an LLThread::id_t, wants a distinguished value meaning
NO_THREAD, and had an enum with that name. But as std:🧵:id promises
that the default-constructed value is distinct from every valid value,
NO_THREAD becomes unnecessary and goes away.

Because LLMutex now stores LLThread::id_t instead of U32, make llmutex.h
#include "llthread.h" instead of the other way around. This makes LLMutex an
incomplete type within llthread.h, so move LLThread::lockData() and
unlockData() to the .cpp file. Similarly, remove llrefcount.h's #include
"llmutex.h" to break circularity; instead forward-declare LLMutex.

It turns out that a number of source files assumed that #include "llthread.h"
would get the definition for LLMutex. Sprinkle #include "llmutex.h" as needed.

In the SAFE_SSL code in llcorehttp/httpcommon.cpp, there's an ssl_thread_id()
callback that returns an unsigned long to the SSL library. When LLThread::
currentID() was U32, we could simply return that. But std:🧵:id is very
deliberately opaque, and can't be reinterpret_cast to unsigned long.
Fortunately it can be hashed because std::hash is specialized with that type.
2020-03-25 15:28:17 -04:00
andreykproductengine fa15830e02 SL-10291 Replace apr_atomic with standard C++11 functionality 2019-01-15 18:31:17 +02:00
andreykproductengine 26fae750ba SL-10291 Replace apr_mutex with standard C++11 functionality 2019-01-14 22:04:44 +02:00
Richard Linden 80b4a4a1f5 merge with release 2014-02-24 18:45:59 -08:00
Richard Linden e340009fc5 second phase summer cleaning
replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc.
2013-08-09 17:11:19 -07:00
Richard Linden 3c341a11ab SH-3468 WIP add memory tracking base class
more fixes for unit test crashes
added llcommon initialization/teardown for unit tests
that indirectly trigger lltrace
changed access of atomic refcount to use preincrement/decrement
operators to reflect desired semantics
always call apr_initialize in LLCommon::initClass, even
if already initialized...apr does internal reference counting
to keep things straight
2013-01-08 00:25:07 -08:00
Richard Linden 68967e7b2b SH-3406 WIP convert fast timers to lltrace system
changed thread id declaration to be local to llthread.cpp and use
currentID() uniformly across platforms
2012-12-05 14:22:18 -08:00
Richard Linden 5d51175cd7 SH-3406 WIP convert fast timers to lltrace system
fixes to merge
2012-11-20 15:55:04 -08:00
Richard Linden 735fde8c74 SH-3275 WIP Run viewer metrics for object update messages
added LLThreadLocalPtr
broke llmutex out into llmutex.h
got primary sampling buffer under thread local storage
2012-09-21 18:52:08 -07:00