---
title: "LockableObject Class"
canonical: https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_LockableObject.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# LockableObject Class
 
This class contains partial implementation of the [ILockable](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_ILockable.htm.md) interface and used by all thread safe Graphics Mill for .NET classes.
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Class LockableObject _Implements ILockable, IDisposable
```
 
```csharp
public class LockableObject : ILockable, IDisposable
```
 
## Remarks
  
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()](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_LockableObject_Lock.htm.md). When you no longer needed to lock the object, unlock it with [Unlock()](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_LockableObject_Unlock.htm.md) 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](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_LockableObject_Locked.htm.md) property. You can also use a timeout [Timeout](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_LockableObject_Timeout.htm.md) 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](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_LockableObject_Timeout.htm.md) property as a solution of the deadlock problem.
 
## Inheritance Hierarchy
  
- [System.Object](http://msdn2.microsoft.com/en-us/e5kfa45b)
    - Aurigma.GraphicsMill.LockableObject
        - [Aurigma.GraphicsMill.UnitConverterObject](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_UnitConverterObject.htm.md)
        - [Aurigma.GraphicsMill.ColorPalette](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_ColorPalette.htm.md)
        - [Aurigma.GraphicsMill.ColorProfile](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_ColorProfile.htm.md)
        - [Aurigma.GraphicsMill.ChannelsProvider](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_ChannelsProvider.htm.md)
        - [Aurigma.GraphicsMill.Histogram](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Histogram.htm.md)
        - [Aurigma.GraphicsMill.ColorAdjustmentProvider](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_ColorAdjustmentProvider.htm.md)
        - [Aurigma.GraphicsMill.TransformsProvider](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_TransformsProvider.htm.md)
        - [Aurigma.GraphicsMill.BitmapStatisticsProvider](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_BitmapStatisticsProvider.htm.md)
        - [Aurigma.GraphicsMill.BitmapData](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_BitmapData.htm.md)
        - [Aurigma.GraphicsMill.ColorManagementProvider](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_ColorManagementProvider.htm.md)
        - [Aurigma.GraphicsMill.Codecs.AviAudioManager](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_AviAudioManager.htm.md)
        - [Aurigma.GraphicsMill.Codecs.AviWatermark](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_AviWatermark.htm.md)
        - [Aurigma.GraphicsMill.Codecs.AviTransition](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_AviTransition.htm.md)
        - [Aurigma.GraphicsMill.Codecs.Frame](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_Frame.htm.md)
        - [Aurigma.GraphicsMill.Codecs.XmpNode](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_XmpNode.htm.md)
        - [Aurigma.GraphicsMill.Codecs.MetadataDictionary](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_MetadataDictionary.htm.md)
        - [Aurigma.GraphicsMill.Codecs.XmpData](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_XmpData.htm.md)
        - [Aurigma.GraphicsMill.Transforms.Matrix](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_Matrix.htm.md)
        - [Aurigma.GraphicsMill.Transforms.Lut](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_Lut.htm.md)
 
## Thread Safety
 Static members of this type are safe for multi-threaded operations. Instance members of this type are safe for multi-threaded operations.
   
## See Also

### Reference

- [LockableObject Members](https://www.graphicsmill.com/docs/gm5/AllMembers_T_Aurigma_GraphicsMill_LockableObject.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
