Jump to content

Unigine:Ptr thread safety


photo

Recommended Posts

Posted

Hi,

Am I right to assume that Unigine::Ptr operations are not thread safe (looks that way)?

For example:

Unigine::TexturePtr tex;

thread 1:

someFunctionCall(tex);

do something with tex there.

thread 2:

tex = Unigine::TexturePtr(nullptr); or just assign another pointer.

I think thread 1 can end up with incorrect tex pointer at one point (partially destroyed).

So everytime I access a pointer I should lock / unlock around it?

Kind Regards,

Adrian Licu

Posted

Ok, thanks. Yes, I know that link. So I need to do my own guarding locks when dealing with pointers.

×
×
  • Create New...