<feed xmlns='http://www.w3.org/2005/Atom'>
<title>viewer.git/indra/llcommon/tests/llinstancetracker_test.cpp, branch cef_147</title>
<subtitle>Megapahit's fork of the Second Life viewer.
</subtitle>
<id>https://megapahit.org/viewer.git/atom?h=cef_147</id>
<link rel='self' href='https://megapahit.org/viewer.git/atom?h=cef_147'/>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/'/>
<updated>2024-08-20T15:41:48Z</updated>
<entry>
<title>Clean up boost includes and remove compiler warning pragma for unreachable code in PCH (#2361)</title>
<updated>2024-08-20T15:41:48Z</updated>
<author>
<name>Ansariel Hiller</name>
<email>Ansariel@users.noreply.github.com</email>
</author>
<published>2024-08-20T15:41:48Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=9f7dd0177201fe080c287144b99a70125be1fb2b'/>
<id>urn:sha1:9f7dd0177201fe080c287144b99a70125be1fb2b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>#824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed</title>
<updated>2024-04-29T04:56:09Z</updated>
<author>
<name>Andrey Lihatskiy</name>
<email>alihatskiy@productengine.com</email>
</author>
<published>2024-04-29T04:43:28Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=1b68f71348ecf3983b76b40d7940da8377f049b7'/>
<id>urn:sha1:1b68f71348ecf3983b76b40d7940da8377f049b7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>replace boost library to standard</title>
<updated>2024-01-08T21:29:21Z</updated>
<author>
<name>AiraYumi</name>
<email>aira.youme@airanyumi.net</email>
</author>
<published>2024-01-06T14:29:06Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=7c8907522fe6600918dacc15ee138ca72b2cf35e'/>
<id>urn:sha1:7c8907522fe6600918dacc15ee138ca72b2cf35e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>SL-16024: Adapt llinstancetracker_test.cpp to getInstance() change.</title>
<updated>2021-10-07T18:00:39Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2021-10-07T18:00:39Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=b554c9eaf45c83500e6b65e295cc507b9a3d537b'/>
<id>urn:sha1:b554c9eaf45c83500e6b65e295cc507b9a3d537b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>DRTVWR-476: Re-enable LLInstanceTracker tests disabled months ago.</title>
<updated>2020-03-25T23:25:42Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2019-12-18T18:03:00Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=4a046b844bea9edd3edf22d4ae1325817c90b881'/>
<id>urn:sha1:4a046b844bea9edd3edf22d4ae1325817c90b881</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[DRTVWR-476] - temporary skip failing llinstancetracker tests to get TC build working</title>
<updated>2020-03-25T22:40:45Z</updated>
<author>
<name>Anchor</name>
<email>none@none</email>
</author>
<published>2019-06-05T08:31:30Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=f0b07eafa2814c26e9a11b35d0f31dc2988579b2'/>
<id>urn:sha1:f0b07eafa2814c26e9a11b35d0f31dc2988579b2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>DRTVWR-494: Defend LLInstanceTracker against multi-thread usage.</title>
<updated>2020-03-25T19:28:17Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2019-12-02T19:39:24Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=9d5b897600a8f9405ec37a141b9417f34a11c557'/>
<id>urn:sha1:9d5b897600a8f9405ec37a141b9417f34a11c557</id>
<content type='text'>
The previous implementation went to some effort to crash if anyone attempted
to create or destroy an LLInstanceTracker subclass instance during traversal.
That restriction is manageable within a single thread, but becomes unworkable
if it's possible that a given subclass might be used on more than one thread.

Remove LLInstanceTracker::instance_iter, beginInstances(), endInstances(),
also key_iter, beginKeys() and endKeys(). Instead, introduce key_snapshot()
and instance_snapshot(), the only means of iterating over LLInstanceTracker
instances. (These are intended to resemble functions, but in fact the current
implementation simply presents the classes.) Iterating over a captured
snapshot defends against container modifications during traversal. The term
'snapshot' reminds the coder that a new instance created during traversal will
not be considered. To defend against instance deletion during traversal, a
snapshot stores std::weak_ptrs which it lazily dereferences, skipping on the
fly any that have expired.

Dereferencing instance_snapshot::iterator gets you a reference rather than a
pointer. Because some use cases want to delete all existing instances, add an
instance_snapshot::deleteAll() method that extracts the pointer. Those cases
used to require explicitly copying instance pointers into a separate
container; instance_snapshot() now takes care of that. It remains the caller's
responsibility to ensure that all instances of that LLInstanceTracker subclass
were allocated on the heap.

Replace unkeyed static LLInstanceTracker::getInstance(T*) -- which returned
nullptr if that instance had been destroyed -- with new getWeak() method
returning std::weak_ptr&lt;T&gt;. Caller must detect expiration of that weak_ptr.

Adjust tests accordingly.

Use of std::weak_ptr to detect expired instances requires engaging
std::shared_ptr in the constructor. We now store shared_ptrs in the static
containers (std::map for keyed, std::set for unkeyed).

Make LLInstanceTrackerBase a template parameterized on the type of the static
data it manages. For that reason, hoist static data class declarations out of
the class definitions to an LLInstanceTrackerStuff namespace.

Remove the static atomic sIterationNestDepth and its methods incrementDepth(),
decrementDepth() and getDepth(), since they were used only to forbid creation
and destruction during traversal.

Add a std::mutex to static data. Introduce an internal LockStatic class that
locks the mutex while providing a pointer to static data, making that the only
way to access the static data.

The LLINSTANCETRACKER_DTOR_NOEXCEPT macro goes away because we no longer
expect ~LLInstanceTracker() to throw an exception in test programs.
That affects LLTrace::StatBase as well as LLInstanceTracker itself.

Adapt consumers to the new LLInstanceTracker API.
</content>
</entry>
<entry>
<title>DRTVWR-493: Make catch_llerrs() a member of WrapLLErrs.</title>
<updated>2019-08-12T12:26:51Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2019-08-12T12:26:51Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=f0fa4f94a5400fe5d21cf5bf7570129916bf9787'/>
<id>urn:sha1:f0fa4f94a5400fe5d21cf5bf7570129916bf9787</id>
<content type='text'>
</content>
</entry>
<entry>
<title>DRTVWR-493: Introduce test catch_what(), catch_llerrs() functions.</title>
<updated>2019-08-11T00:33:59Z</updated>
<author>
<name>Nat Goodspeed</name>
<email>nat@lindenlab.com</email>
</author>
<published>2019-08-11T00:33:59Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=adb3f447b33e42bdb6e4a5a1ac79eebd862dafb4'/>
<id>urn:sha1:adb3f447b33e42bdb6e4a5a1ac79eebd862dafb4</id>
<content type='text'>
Use them in place of awkward try/catch test boilerplate.
</content>
</entry>
<entry>
<title>remove execute permission from many files that should not have it</title>
<updated>2015-11-10T14:48:56Z</updated>
<author>
<name>Oz Linden</name>
<email>oz@lindenlab.com</email>
</author>
<published>2015-11-10T14:48:56Z</published>
<link rel='alternate' type='text/html' href='https://megapahit.org/viewer.git/commit/?id=c8726aba303bcf1207b730a344536e25491420bc'/>
<id>urn:sha1:c8726aba303bcf1207b730a344536e25491420bc</id>
<content type='text'>
</content>
</entry>
</feed>
