Commit Graph

46 Commits (a135b5b428acde9b784418dea5d990de5f188f4c)

Author SHA1 Message Date
Nicky Dasmijn a135b5b428 Merge remote-tracking branch 'origin/ll-vs2017' into fs-vs2017 2019-12-21 13:14:51 +01:00
Nat Goodspeed 24499ac66f Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2019-12-13 12:30:03 -05:00
Ansariel 797fa6718b Merge 494-maint-wassail 2019-11-28 17:09:26 +01:00
Nat Goodspeed b2913b7cf1 DRTVWR-494: Defend LLInstanceTracker against multi-thread usage.
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<T>. 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.
2019-12-02 14:39:24 -05:00
AndreyL ProductEngine 8a0338bda0 Backed out changeset: 3ea1714b65b8 2019-11-20 21:41:27 +02:00
Ansariel 3bc189bda7 Merge Firestorm LGPL 2019-11-19 20:28:09 +01:00
AndreyL ProductEngine 84f3b2865f Merged in lindenlab/viewer-release 2019-11-12 00:39:07 +02:00
Ansariel 6e340961c0 Merge viewer-neko 2019-10-30 18:05:01 +01:00
Ansariel 46f739f348 Merge viewer-lynx 2019-10-29 18:32:17 +01:00
andreykproductengine 43809e1c5c SL-12180 Crash on requestOfflineMessagesCoro 2019-10-23 22:37:59 +03:00
Ansariel d79b79fbe2 Merge viewer-ordered-shutdown 2019-10-19 03:16:10 +02:00
Ansariel 146d527104 Merge viewer-neko 2019-10-09 22:05:52 +02:00
Rider Linden a9a2ca0d74 SL-11430: Transaction ID is passed as aux_id from offline message. No special parsing required to get type from binary_bucket. 2019-10-01 16:49:33 -07:00
Rider Linden 3feba8be0d SL-11430: Transaction ID is passed as aux_id from offline message. No special parsing required to get type from binary_bucket. 2019-10-01 16:49:33 -07:00
Ansariel e8b426d1c2 Merge viewer-neko 2019-09-11 17:34:55 +02:00
maxim_productengine 05fcbb5df9 SL-11909 FIXED Crash in Second Life Release!LLIMProcessing::requestOfflineMessagesCoro 2019-09-10 17:55:27 +03:00
Mnikolenko Productengine 96c78187c1 SL-12129 FIXED Object IMs doesn't react to an instant message from an object. 2019-10-17 14:48:31 +03:00
andreykproductengine 779b5627c5 DRTVWR-493 LLAvatarNameCache to singletone 2019-07-03 20:06:47 +03:00
Ansariel 3a251bb0f8 Merge viewer-neko 2019-06-27 17:52:20 +02:00
andreykproductengine a05046f4c0 SL-11454 Exception for muted objects, such offers should get declined 2019-06-27 17:52:11 +03:00
Ansariel bc60d396d5 Merge viewer-neko 2019-06-26 21:20:12 +02:00
andreykproductengine d392b97aa7 SL-11454 Dismissing group notice should move attachment to trash 2019-06-26 17:00:43 +03:00
Ansariel 8d9bf076ff Merge Firestorm LGPL 2019-01-10 21:12:02 +01:00
Ansariel 69dadde429 FIRE-23476: Don't select inventory offer in inventory under AutoAcceptNewInventory && !ShowInInventory && ShowNewInventory condition 2019-01-08 18:45:42 +01:00
Ansariel 0e36db79e1 Merge viewer-neko 2018-12-01 16:34:33 +01:00
Ansariel 5e5240b697 FIRE-23169: Fix offline inventory offers getting lost 2018-10-25 18:42:50 +02:00
Ansariel c0741009d8 Bring back FSUseReadOfflineMsgsCap debug setting to disable offline message request cap and enable disable it by default 2018-09-27 19:38:06 +02:00
Ansariel fa7b0bb78e Merge viewer-neko 2018-07-15 14:58:49 +02:00
andreykproductengine dc0bd05717 SL-927 Add new groups caps to viewer (offline messages only) 2018-06-26 14:47:30 +03:00
Ansariel e30cabff93 Merge viewer-neko 2018-04-13 00:27:27 +02:00
AndreyL ProductEngine 46817fcbd3 Merged in lindenlab/viewer-lynx 2018-04-12 21:24:36 +03:00
Andrey Kleshchev 980ebf5d94 MAINT-8489 Remove/Cleanup LLIMInfo 2018-04-10 15:59:21 +00:00
Andrey Kleshchev b5d72cf657 MAINT-8203 Restore legacy name lookup 2018-04-06 14:15:11 +00:00
Andrey Kleshchev ebdd2ca53f MAINT-8203 Restore legacy name lookup 2018-04-06 14:15:11 +00:00
andreykproductengine b58fb1bfff MAINT-8203 LLIMInfo crash due to capability 2018-04-02 17:32:11 +03:00
Ansariel e6ffcf875b Fix indention in llimprocessing.cpp 2018-04-04 21:19:17 +02:00
Ansariel c0149a8f09 Manually merge of MAINT-8203 Group notices processing 2018-04-04 20:57:01 +02:00
andreykproductengine 47f5a2f7f9 MAINT-8203 LLIMInfo crash due to capability 2018-04-02 17:32:11 +03:00
Ansariel f8fbf8aafa Somehow this got buggered up... 2018-03-30 22:45:55 +02:00
Ansariel c2aea4ff34 Add debug option FSUseReadOfflineMsgsCap to disable reading offline messages via cap and disable by default for now while it's still broken 2018-03-30 11:28:19 +02:00
andreykproductengine eb6b389b99 MAINT-8203 Group notices processing 2018-03-27 17:22:17 +03:00
andreykproductengine fb145f4994 MAINT-8203 Fixing from_group processing in ReadOfflineMsgs cap 2018-03-24 14:48:39 +02:00
andreykproductengine e734529de8 MAINT-8203 Fixing from_group processing in ReadOfflineMsgs cap 2018-03-24 14:48:39 +02:00
Ansariel f7b531b0ff Manually shuffle things around for MAINT-8203 Use the ReadOfflineMsgs cap to fetch IMs after login 2018-03-13 19:22:25 +01:00
andreykproductengine 2835e77640 MAINT-8203 Use the ReadOfflineMsgs cap to fetch IMs after login 2018-02-13 15:40:21 +02:00
andreykproductengine ab0d3f09d7 SL-9975 All offline inventory offers from scripted objects are lost 2018-11-14 17:15:11 +02:00