https://bugs.freedesktop.org/show_bug.cgi?id=106302
--- Comment #1 from Pierre-Eric Pelloux-Prayer pierre-eric@damsy.net --- I can reproduce but I don't think it's a bug in Mesa: your createTexture() function doesn't use any synchronization mechanisms so you can't expect the other thread/context to pick up the changes mades to the texture.
Adding a call to glFlush or glFinish at the end of createTexture() is enough in this case to fix the issue.