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

Commit 606e71cf authored by Wonsik Kim's avatar Wonsik Kim
Browse files

WebmFrameThread: clear mThread after join.

Bug: 36260305
Test: cts-tradefed run cts-dev --module CtsMediaTestCases --test android.media.cts.NativeDecoderTest
Change-Id: Ifd0ce7d6df71e514b26a4cc2b1c4fe99eacf0f7e
parent 5a1ebf93
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -37,17 +37,23 @@ void *WebmFrameThread::wrap(void *arg) {
}

status_t WebmFrameThread::start() {
    status_t err = OK;
    pthread_attr_t attr;
    pthread_attr_init(&attr);
    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
    pthread_create(&mThread, &attr, WebmFrameThread::wrap, this);
    if ((err = pthread_create(&mThread, &attr, WebmFrameThread::wrap, this))) {
        mThread = 0;
    }
    pthread_attr_destroy(&attr);
    return OK;
    return err;
}

status_t WebmFrameThread::stop() {
    void *status;
    void *status = nullptr;
    if (mThread) {
        pthread_join(mThread, &status);
        mThread = 0;
    }
    return (status_t)(intptr_t)status;
}