Gl Create Vertex Arrays in thread does not generate buffer/array

Hi, I am creating my own graphics engine and noticed that vertex/element buffers are not created in a separate thread, example:
Everything is going well here:

Personaj* persik = new Personaj(igra.VzyatOsnovShaderProgId(), versh, inds, "biblioteka/ya.png");
obnov += persik;
otrisovat += persik;
etotIgrok.pers = persik;

But when I create a character in a separate thread, gl Create Vertex Arrays and glGenBuffers do not create buffers with arrays

potok = std::thread([&]() {
  Personaj* persik = new Personaj(igra.VzyatOsnovShaderProgId(), versh, inds, "biblioteka/ya.png");
  obnov += persik;
  otrisovat += persik;
  etotIgrok.pers = persik;
});

The function of generating buffers and arrays for a new character

void DDModel::ObnovitVershini(GLuint& proga, Massiv<Vershina>& vershini_per, Massiv<GLuint>& indeksi_per)
{
    vershini = vershini_per;
    indeksi = indeksi_per;
 
    if (VAO)
        glDeleteVertexArrays(1, &VAO);
    if (VBO)
        glDeleteBuffers(1, &VBO);
    if (EBO)
        glDeleteBuffers(1, &EBO);
 
    glCreateVertexArrays(1, &VAO);
    glBindVertexArray(VAO);
 
    glGenBuffers(1, &VBO);
    glBindBuffer(GL_ARRAY_BUFFER, VBO);
    glBufferData(GL_ARRAY_BUFFER, vershini.VzyatRazmer() * sizeof(Vershina), vershini.VzyatMas(), GL_STATIC_DRAW);
    glGenBuffers(1, &EBO);
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO);
    glBufferData(GL_ELEMENT_ARRAY_BUFFER, indeksi.VzyatRazmer() * sizeof(GLuint), indeksi.VzyatMas(), GL_STATIC_DRAW);
 
    GLuint attribMest = glGetAttribLocation(proga, "mesto_vershini");
    glVertexAttribPointer(attribMest, 3, GL_FLOAT, GL_FALSE, sizeof(Vershina), (GLvoid*)offsetof(Vershina, mesto));
    glEnableVertexAttribArray(attribMest);
 
    attribMest = glGetAttribLocation(proga, "cvetKoordi_vershini");
    glVertexAttribPointer(attribMest, 2, GL_FLOAT, GL_FALSE, sizeof(Vershina), (GLvoid*)offsetof(Vershina, cvetKoordi));
    glEnableVertexAttribArray(attribMest);
 
    glBindVertexArray(0);
}

OpenGL functions work only when OpenGL Context is active in the thread. In glfw opengl context is activated with glfwMakeContextCurrent function. Only then you are allowed to call GL functions. See GLFW: Context guide.

Ideally you want to keep all your GL calls in single rendering thread. You can do whatever other data loading & processing things on threads. But just always give control to main thread when you actually need to call GL functions.

There are ways to create multiple GL contexts, one for each thread and then share data between them, but that part always was very buggy in OpenGL drivers. I would not recommend going down that path.