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

Commit fe7c2a50 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change I996db8da into eclair

* changes:
  Fix tls crash on startup if more than one RS contexts are created in one process.
parents 521f4f3a 996db8da
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());