[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] BUG: sprite module is not thread safe.



"""The sprite interface bing written over sdl in python is not thread safe.
If you want multiple threads manipulating sprites in a pygame app you
need to lock the SpriteGroup, while draw()' inig it.

I didn't do any extensive tests, but if i try to kill() a sprite
(remove it from a group) the code will sometimes crash if another
thread is in the process of drawing the group (KeyError: <Sprite
sprite(in 0 groups)>)
"""

I added a note to the docs about the sprite module not being thread
safe.  Not that it was intended to be thread safe.