Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 996db8da authored by Jason Sams's avatar Jason Sams
Browse files

Fix tls crash on startup if more than one RS contexts are created in one process.

parent 516c3191
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -304,11 +304,16 @@ Context::Context(Device *dev, Surface *sur, bool useDepth)
    int status;
    pthread_attr_t threadAttr;

    if (!gThreadTLSKey) {
        status = pthread_key_create(&gThreadTLSKey, NULL);
        if (status) {
            LOGE("Failed to init thread tls key.");
            return;
        }
    } else {
        // HACK: workaround gl hang on start
        exit(-1);
    }

    status = pthread_attr_init(&threadAttr);
    if (status) {
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ bool ScriptC::run(Context *rsc, uint32_t launchIndex)
{
    Context::ScriptTLSStruct * tls =
    (Context::ScriptTLSStruct *)pthread_getspecific(Context::gThreadTLSKey);
    rsAssert(tls);

    if (mEnviroment.mFragmentStore.get()) {
        rsc->setFragmentStore(mEnviroment.mFragmentStore.get());