stilldesign / PhysX.Net

A .NET wrapper for NVIDIA PhysX 4.1.2 written using C++/CLI.
MIT License
206 stars 54 forks source link

Multi-threading protection for ObjectTable operations #12

Closed gepa21 closed 5 years ago

stilldesign commented 9 years ago

Nice work on the PRs George :) Just as a side note, I came across this as alternative code to performing locks in C++/CLI; http://stackoverflow.com/questions/1369459/cs-lock-in-managed-c/7527111#7527111 - Seemed pretty cool

gepa21 commented 9 years ago

oh.. that is indeed interesting! ...but can you exit the lock mid-function? because in the ObjectTable case events should not be fired while keeping the lock (i guess you could destruct/dispose it)

[update] ok nevermind i get it now, it is released when it goes out of scope. :)