MutexPosixImpl assertion with GeomVertexRewriter

Hey guys,
Trying to update a custom terrain, made out of a single GeomNode, which has a series of GeomPrimitives, GeomTristrips. Building the terrain is fine. Trying to update it at 10 Hz is a problem though.
Sometimes it will work for a while, sometimes it will crash right away, so definitely a race condition.
I’m only modifying the positions of the geometries, not reordering the primitive array.
Just calling

PT(GeomVertexData) moddata = terrain_geom_->modify_vertex_data();
GeomVertexRewriter vertex = GeomVertexRewriter(moddata, "vertex");

causes it to crash. I’m not even changing values yet.
The error I get is

/usr/include/panda3d/mutexPosixImpl.I:42: MutexPosixImpl::~MutexPosixImpl(): Assertion `result == 0' failed.

I was wondering if perhaps I have multiple primitives inside the Geom, but switched that to a single primitive and still doing the same.
Also, I’m setting up the GeomVertexData like this

new GeomVertexData("terrain", GeomVertexFormat::get_v3c4(), Geom::UH_static);

Thoughts?

This is a known issue:
bugs.launchpad.net/bugs/1202448

Ahh, I see. Any ideas to a workaround until the fix is released? I haven’t had this issue in the past when implementing similar dynamic geometry processes. Not sure what I’m doing this time that is different other than using a different primitive type.

The workaround is not to use threading for now.

I just encountered the same, while using Python. Searching revealed, that other topics seem to exist, e.g. [url]Help on a tenacious bug], but a real solution does not.

I would be fine, to un-Thread it, but how would I go about it?
Currently there is one function, which writes Panda-Things (e.g. insert and remove models), which runs as a Thread. When it would be called directly, it would block, never return and then Panda won’t render anything (The window stays black).

Important code parts:

opencommands=Queue()

class App(ShowBase):
  def __init__(self):
    ShowBase.__init__(self)
    ############# handle incomming commands
    # Current, Threaded solution:
    self.processing=True
    command_thread=Thread(target=self.processCommands)
    command_thread.daemon=True
    command_thread.start()
    

  def processCommands(self):
    '''
    Only this thread may call functions, that write any kind of data.
    '''
    while self.processing:
      cmd=opencommands.get(True,None)
      opencommands.task_done()
      cmdID=cmd[0]
      args=cmd[1]
      self.commandToF[cmdID](args)

app = App()
app.run()

Edit: The error occurs, when models are added using

model=loader.loadModel(modelfile)
#....
placeholder=render.attachNewNode('modelplaceholder')
placeholder.setPos(tx*C.TILESIZE+twidth*0.5*C.TILESIZE,ty*C.TILESIZE+theight*0.5*C.TILESIZE,0)
model.instanceTo(placeholder)

The code is called from aforementioned Thread.