Skip to content

Rye/llsingleton dll safe#328

Merged
RyeMutt merged 9 commits into
developfrom
rye/llsingleton-dll-safe
Jun 26, 2026
Merged

Rye/llsingleton dll safe#328
RyeMutt merged 9 commits into
developfrom
rye/llsingleton-dll-safe

Conversation

@RyeMutt

@RyeMutt RyeMutt commented Jun 26, 2026

Copy link
Copy Markdown
Member

Description

Related Issues

  • Please link to a relevant GitHub issue for additional context.
    • Bug Fix: Link to an issue that includes reproduction steps and testing guidance.
    • Feature/Enhancement: Link to an issue with a write-up, rationale, and requirements.

Issue Link:


Checklist

Please ensure the following before requesting review:

  • I have provided a clear title and detailed description for this pull request.
  • If useful, I have included media such as screenshots and video to show off my changes.
  • I have tested the changes locally and verified they work as intended.
  • All new and existing tests pass.
  • Code follows the project's style guidelines.
  • Documentation has been updated if needed.
  • Any dependent changes have been merged and published in downstream modules
  • I have reviewed the contributing guidelines.

Additional Notes

RyeMutt and others added 9 commits June 25, 2026 01:34
… LLParamSingleton

Make LLSingleton safe for a future shared (multi-DLL) llcommon and restore
LLParamSingleton so the DLL-unsafe LLSimpleton can be retired, without
reintroducing the per-access mutex locking that motivated LLSimpleton.

Storage: per-type instance state moves out of the per-T function-local/template
static (which duplicates once per module under DLLs) into a single process-wide
registry owned by LLSingletonBase::getSlot() in llsingleton.cpp. Every module
resolves the same SingletonSlot; LLSingleton<T> keeps only a per-module cache of
the slot's stable address. The registry is keyed by the mangled name string
(typeid(T).name()), not std::type_index: we build with -fvisibility=hidden, so
each module has its own type_info object for T and type_index would compare
unequal across modules and duplicate the slot.

Performance: getInstance()/instanceExists() take a lock-free fast path in steady
state -- an acquire load of an atomic instance pointer published only at
INITIALIZED. Dependency tracking is fully preserved: the fast path is gated on a
process-wide sInitializingDepth counter, so whenever any singleton is mid-init
every caller falls back to the locked, capture_dependency() path.

DLL export: mark class LLSingletonBase LL_COMMON_API so its out-of-line methods,
getSlot, and sInitializingDepth are reachable across module boundaries.

Restore LLParamSingleton and LLLockedSingleton (adapted to the slot internals +
fast path) and their unit tests. INTEGRATION_TEST_llsingleton: 15/15 pass,
including the dependency-ordered deleteAll() checks.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 226 files, which is 76 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 13a2cac4-2dc8-4e9c-9af4-039c4f74f3cd

📥 Commits

Reviewing files that changed from the base of the PR and between 9cf2fab and b635d8d.

📒 Files selected for processing (226)
  • indra/cmake/LLAddBuildTest.cmake
  • indra/integration_tests/llimage_libtest/llimage_libtest.cpp
  • indra/llappearance/llavatarappearance.cpp
  • indra/llappearance/llwearabletype.cpp
  • indra/llappearance/llwearabletype.h
  • indra/llappearanceutility/llappappearanceutility.cpp
  • indra/llappearanceutility/llappappearanceutility.h
  • indra/llappearanceutility/llbakingtexlayer.cpp
  • indra/llappearanceutility/llbakingtexture.cpp
  • indra/llappearanceutility/llbakingtexture.h
  • indra/llappearanceutility/llprocesstexture.cpp
  • indra/llcommon/CMakeLists.txt
  • indra/llcommon/apply.h
  • indra/llcommon/hbxxh.h
  • indra/llcommon/lazyeventapi.h
  • indra/llcommon/llapp.h
  • indra/llcommon/llassettype.cpp
  • indra/llcommon/llassettype.h
  • indra/llcommon/llcallbacklist.h
  • indra/llcommon/llcleanup.h
  • indra/llcommon/llcoros.cpp
  • indra/llcommon/llcoros.h
  • indra/llcommon/llerror.h
  • indra/llcommon/lleventcoro.h
  • indra/llcommon/lleventfilter.h
  • indra/llcommon/llexception.h
  • indra/llcommon/llfasttimer.cpp
  • indra/llcommon/llfasttimer.h
  • indra/llcommon/llfile.h
  • indra/llcommon/llheteromap.h
  • indra/llcommon/llinitdestroyclass.h
  • indra/llcommon/llinitparam.h
  • indra/llcommon/llinstancetracker.h
  • indra/llcommon/llkeybind.h
  • indra/llcommon/llmetricperformancetester.cpp
  • indra/llcommon/llmetricperformancetester.h
  • indra/llcommon/llmutex.cpp
  • indra/llcommon/llmutex.h
  • indra/llcommon/llpointer.h
  • indra/llcommon/llpredicate.h
  • indra/llcommon/llprocess.cpp
  • indra/llcommon/llprocess.h
  • indra/llcommon/llrand.cpp
  • indra/llcommon/llregex.h
  • indra/llcommon/llsdjson.h
  • indra/llcommon/llsdserialize.cpp
  • indra/llcommon/llsdutil.h
  • indra/llcommon/llsingleton.cpp
  • indra/llcommon/llsingleton.h
  • indra/llcommon/llstaticstringtable.h
  • indra/llcommon/llstring.cpp
  • indra/llcommon/llstring.h
  • indra/llcommon/llthread.cpp
  • indra/llcommon/llthread.h
  • indra/llcommon/llthreadlocalstorage.h
  • indra/llcommon/lltimer.h
  • indra/llcommon/lltrace.h
  • indra/llcommon/lltraceaccumulators.h
  • indra/llcommon/lltracerecording.h
  • indra/llcommon/lltracethreadrecorder.h
  • indra/llcommon/lluuid.cpp
  • indra/llcommon/lluuid.h
  • indra/llcommon/llwatchdog.h
  • indra/llcommon/llwin32headers.h
  • indra/llcommon/lockstatic.h
  • indra/llcommon/tests/llcond_test.cpp
  • indra/llcommon/tests/lleventcoro_test.cpp
  • indra/llcommon/tests/lleventfilter_test.cpp
  • indra/llcommon/tests/llsdutil_test.cpp
  • indra/llcommon/tests/llsingleton_test.cpp
  • indra/llcommon/tests/lluuid_test.cpp
  • indra/llcommon/tests/workqueue_test.cpp
  • indra/llcommon/threadpool.h
  • indra/llcommon/workqueue.h
  • indra/llfilesystem/lldiskcache.h
  • indra/llfilesystem/llfilesystem.cpp
  • indra/llimage/llimagej2c.cpp
  • indra/llimage/llimagej2c.h
  • indra/llinventory/llfoldertype.cpp
  • indra/llinventory/llfoldertype.h
  • indra/llinventory/llinventorysettings.h
  • indra/llinventory/llinventorytype.cpp
  • indra/llinventory/llinventorytype.h
  • indra/llinventory/tests/inventorymisc_test.cpp
  • indra/llmath/CMakeLists.txt
  • indra/llmath/tests/llsdutil_math_test.cpp
  • indra/llmessage/llavatarnamecache.h
  • indra/llmessage/llpumpio.h
  • indra/llmessage/lltemplatemessagereader.cpp
  • indra/llmessage/tests/io_test.cpp
  • indra/llmessage/tests/llcoproceduremanager_test.cpp
  • indra/llplugin/slplugin/CMakeLists.txt
  • indra/llprecompiled/CMakeLists.txt
  • indra/llprimitive/tests/llgltfmaterial_test.cpp
  • indra/llprimitive/tests/llmaterial_test.cpp
  • indra/llprimitive/tests/llmaterialid_test.cpp
  • indra/llrender/llrender.cpp
  • indra/llrender/lltexture.cpp
  • indra/llrender/lltexture.h
  • indra/llui/llcommandmanager.h
  • indra/llui/llemojidictionary.cpp
  • indra/llui/llemojidictionary.h
  • indra/llui/llfolderview.cpp
  • indra/llui/llfolderviewitem.cpp
  • indra/llui/llkeywords.cpp
  • indra/llui/llpanel.cpp
  • indra/llui/llui.cpp
  • indra/llui/lluicolortable.h
  • indra/llui/lluictrlfactory.cpp
  • indra/llui/lluictrlfactory.h
  • indra/llui/lluistring.cpp
  • indra/llui/llxuiparser.cpp
  • indra/llui/tests/llemojidictionary_test.cpp
  • indra/llwindow/llcursortypes.h
  • indra/llwindow/llwindowwin32.cpp
  • indra/newview/CMakeLists.txt
  • indra/newview/alstreaminfo.h
  • indra/newview/altoolalign.h
  • indra/newview/llagent.cpp
  • indra/newview/llagentcamera.cpp
  • indra/newview/llappviewer.cpp
  • indra/newview/llappviewer.h
  • indra/newview/llchathistory.cpp
  • indra/newview/llcontrolavatar.h
  • indra/newview/lldebugview.cpp
  • indra/newview/lldebugview.h
  • indra/newview/lldonotdisturbnotificationstorage.cpp
  • indra/newview/lldonotdisturbnotificationstorage.h
  • indra/newview/lldrawable.cpp
  • indra/newview/lldrawpoolavatar.cpp
  • indra/newview/lldrawpoolsimple.cpp
  • indra/newview/lldrawpoolterrain.cpp
  • indra/newview/lldrawpooltree.cpp
  • indra/newview/llenvironment.cpp
  • indra/newview/llfasttimerview.cpp
  • indra/newview/llfasttimerview.h
  • indra/newview/llfilteredwearablelist.cpp
  • indra/newview/llfloaterabout.cpp
  • indra/newview/llfloaterimsessiontab.cpp
  • indra/newview/llfloaterlagmeter.cpp
  • indra/newview/llfolderviewmodelinventory.cpp
  • indra/newview/llgesturemgr.cpp
  • indra/newview/llhudmanager.cpp
  • indra/newview/llhudmanager.h
  • indra/newview/llhudobject.cpp
  • indra/newview/llinventoryicon.cpp
  • indra/newview/llinventoryicon.h
  • indra/newview/llinventorymodelbackgroundfetch.cpp
  • indra/newview/llmaterialmgr.h
  • indra/newview/llmutelist.cpp
  • indra/newview/llmutelist.h
  • indra/newview/llpersistentnotificationstorage.h
  • indra/newview/llsceneview.cpp
  • indra/newview/llstartup.cpp
  • indra/newview/lltexturefetch.cpp
  • indra/newview/lltexturefetch.h
  • indra/newview/lltoolcomp.h
  • indra/newview/lltooldraganddrop.h
  • indra/newview/lltoolface.h
  • indra/newview/lltoolfocus.h
  • indra/newview/lltoolgrab.h
  • indra/newview/lltoolindividual.h
  • indra/newview/lltoolmgr.h
  • indra/newview/lltoolpie.h
  • indra/newview/lltoolpipette.h
  • indra/newview/lltoolselectland.h
  • indra/newview/llviewerfloaterreg.cpp
  • indra/newview/llviewerfoldertype.cpp
  • indra/newview/llviewerfoldertype.h
  • indra/newview/llviewerjoystick.h
  • indra/newview/llviewermedia.cpp
  • indra/newview/llviewermedia.h
  • indra/newview/llviewermenu.cpp
  • indra/newview/llviewernetwork.h
  • indra/newview/llviewerobjectlist.cpp
  • indra/newview/llviewerparcelmgr.h
  • indra/newview/llviewerpartsim.cpp
  • indra/newview/llviewerpartsim.h
  • indra/newview/llviewerregion.cpp
  • indra/newview/llviewerstats.cpp
  • indra/newview/llviewerstats.h
  • indra/newview/llviewertexture.cpp
  • indra/newview/llviewertexture.h
  • indra/newview/llviewerwindow.cpp
  • indra/newview/llvlmanager.cpp
  • indra/newview/llvocache.h
  • indra/newview/llvograss.cpp
  • indra/newview/llvoiceclient.cpp
  • indra/newview/llvoiceclient.h
  • indra/newview/llvoicewebrtc.cpp
  • indra/newview/llvoicewebrtc.h
  • indra/newview/llvovolume.cpp
  • indra/newview/llworldmap.h
  • indra/newview/pipeline.cpp
  • indra/newview/pipeline.h
  • indra/newview/rlveffects.cpp
  • indra/newview/rlvhelper.h
  • indra/newview/skins/default/xui/da/menu_viewer.xml
  • indra/newview/skins/default/xui/de/floater_fast_timers.xml
  • indra/newview/skins/default/xui/de/menu_viewer.xml
  • indra/newview/skins/default/xui/en/floater_fast_timers.xml
  • indra/newview/skins/default/xui/en/menu_viewer.xml
  • indra/newview/skins/default/xui/es/floater_fast_timers.xml
  • indra/newview/skins/default/xui/es/menu_viewer.xml
  • indra/newview/skins/default/xui/fr/floater_fast_timers.xml
  • indra/newview/skins/default/xui/fr/menu_viewer.xml
  • indra/newview/skins/default/xui/it/floater_fast_timers.xml
  • indra/newview/skins/default/xui/it/menu_viewer.xml
  • indra/newview/skins/default/xui/ja/floater_fast_timers.xml
  • indra/newview/skins/default/xui/ja/menu_viewer.xml
  • indra/newview/skins/default/xui/pl/floater_fast_timers.xml
  • indra/newview/skins/default/xui/pl/menu_viewer.xml
  • indra/newview/skins/default/xui/pt/floater_fast_timers.xml
  • indra/newview/skins/default/xui/pt/menu_viewer.xml
  • indra/newview/skins/default/xui/ru/floater_fast_timers.xml
  • indra/newview/skins/default/xui/ru/menu_viewer.xml
  • indra/newview/skins/default/xui/tr/floater_fast_timers.xml
  • indra/newview/skins/default/xui/tr/menu_viewer.xml
  • indra/newview/skins/default/xui/zh/floater_fast_timers.xml
  • indra/newview/skins/default/xui/zh/menu_viewer.xml
  • indra/newview/tests/llslurl_test.cpp
  • indra/newview/tests/llviewernetwork_test.cpp
  • indra/newview/tests/llworldmap_test.cpp
  • indra/vcpkg.json
  • indra/viewer_components/login/tests/lllogin_test.cpp
  • vcpkg

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant