This class contains partial implementation of the ILockable interface and used by all thread safe Graphics Mill for .NET classes.
Namespace:
Aurigma.GraphicsMill
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Public Class LockableObject _ Implements ILockable, IDisposable
public class LockableObject : ILockable, IDisposable
All lockable objects (i.e. classes that are derived from LockableObject) are thread safe.
To prevent the internal data of the object to be modified by another thread, use method Lock(). When you no longer needed to lock the object, unlock it with Unlock() method. Note, standard Graphics Mill for .NET methods are locking the object when necessary, so you need not doing it yourself.
When you try to change the state of the object in the same thread where you lock the object, the deadlock will occur and the application will hang. That's why you should carefully work with locked objects. To verify whether object is locked, use Locked property. You can also use a timeout Timeout property to avoid hanging of the application during deadlock, however you should remember, that deadlock is a flaw in the logic of your code. So you should not rely at Timeout property as a solution of the deadlock problem.