Allow calling LLNotificationsUtil::add from any thread.
This makes LLStringUtil thread-safe by removing a rather unnecessary LLFastTimer from LLStringUtil::format. Same thing for LLTrans::getString and LLTrans::findString, where even a comment stated that the author wasn't interested in measuring cpu time at all. In this case I added some code back to make sure that we're not calling LLTrans::getString() in an inner loop, which was the reason that the LLFastTimer was added. Made one string static to avoid 45000 look ups during login, which kinda triggered the above test. Finally, LLNotificationsUtil::add is made thread-safe by making LLNotificationChannelBase::mItems thread-safe and defering a call to LLNotifications::updateItem to the main thread when called from another thread (using a little statemachine).
This commit is contained in:
@@ -1062,7 +1062,7 @@ void LLFolderViewItem::draw()
|
||||
&& root_is_loading
|
||||
&& mShowLoadStatus))
|
||||
{
|
||||
std::string load_string = " ( " + LLTrans::getString("LoadingData") + " ) ";
|
||||
static std::string const load_string = " ( " + LLTrans::getString("LoadingData") + " ) ";
|
||||
font->renderUTF8(load_string, 0, right_x, y, sSearchStatusColor,
|
||||
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
|
||||
S32_MAX, S32_MAX, &right_x, FALSE);
|
||||
|
||||
Reference in New Issue
Block a user