Multithreading in SDL Mobile

Hi everyone
My name TPham, I am a Game Dev
I have a problem for using multithreading in my project.
I make a function from multihreading to show image “loading data” while the app is loading total data for game lesson.
But, the image “loading data” was not shown.
I run my project on windows, the image is show
But on Android studio. the image is not shown

My Code:
The Init Function:

bool GameMain::LoadData()
{
    DataGame* dataGame = new DataGame();
    dataGame->sWidth = m_ScreenWidth;
    dataGame->sHeight = m_ScreenHeight;
    dataGame->screen = m_Screen;
    SDL_Thread* threadID = SDL_CreateThread(LoadingFunction, "LoadingThread", (void*)dataGame);
    LoadTexture();
    InitLesson1();
    InitLesson2();
    InitLesson3();
    InitLesson4();
    InitEndLesson();
    
    g_Finished = true;  // global variable

    return true;
}

The Thread Function

int LoadingFunction(void* data_game)
{
    DataGame* dataGame = (DataGame*)data_game;
    if (dataGame != NULL)
    {
        DataResize data_resize{ dataGame->sWidth, dataGame->sHeight, true };
        BaseObject bkgnObj;
        bkgnObj.SetIsBackGround(true);
        bkgnObj.SetScreenSize(dataGame->sWidth, dataGame->sHeight);
        bkgnObj.SetDataResize(data_resize);
        bool ret = bkgnObj.LoadImg("bkgn_loading.png", dataGame->screen);
        bkgnObj.SetRect(0, 0);

        while (!g_Finished)
        {
            SDL_SetRenderDrawColor(dataGame->screen, RENDER_DRAW_COLOR,..);
            SDL_RenderClear(dataGame->screen);
            bkgnObj.RenderBkgn(dataGame->screen);
            SDL_RenderPresent(dataGame->screen);
        }
    }

    return 0;
}

I want to get help from everyone. Thank you so much.

All references to textures must be made from the ‘main’ thread (the thread which created the renderer). You can access surfaces from other threads, but not textures.

Thank for your reply.
you mean. I should to using render image from surface in other thread.
Example: SDL_BlitSurface ?

SDL_BlitSurface() is safe to call from another thread, yes. Possibly you could blit your “Loading data” message to a surface in your worker thread, then convert the surface to a texture in your main thread for display.

But might it not be simpler to have a Boolean flag set by your worker thread and tested by your main thread, which directly causes the “Loading data” message to be displayed?