If viewers (or at least, Linden Viewer 1.23.5) receive child hud object updates before the root prim, then the children are not displayed.
Updates were being queued in LLClientView in the right order (root first) but were being sent in a random order since they were all at the same prioritization
This commit prioritizes the root prim of a hud to its highest level when queued.
I'm not sure if the periodic reprioritization triggered via ScenePresence might reset this, but boosting priority appears to work so far.
Also committed is a belt and braces mechanism in LLClientView to prevent child hud prim being sent out before their root, but since this doesn't appear to be needed it is currently commented out.
The root cause of this problem was that multiple ObjectUpdates were being sent on attachment which differed enough to confuse the client.
Sometimes these would eliminate each other and sometimes not, depending on whether the scheduler looked at the queued updates.
The solution here is to only schedule the ObjectUpdate once the attachment code has done all it needs to do.
Backport from head.
* Replaced calls to ThreadPool.QueueUserWorkItem() with ThreadPool.UnsafeQueueUserWorkItem() since OpenSim does not use Code Access Security sandboxing