---
title: "ILockable..::.Lock Method "
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_ILockable_Lock.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/)

# ILockable.Lock Method 
 
Locks the object.
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Sub Lock
```
 
```csharp
void Lock()
```
 
## Remarks
  
After calling this method this object is not accessible from any other thread (until [Unlock()](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_ILockable_Unlock.htm.md) is called). You can safely check [Locked](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_ILockable_Locked.htm.md) property to ensure if object is locked.
 
When you access the object which has been locked, the thread stops and waits until it become unlocked. Using property [Timeout](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_ILockable_Timeout.htm.md) you can specify how much time to wait.
 
**Note** 
All Graphics Mill for .NET method and properties already uses Lock()/[Unlock()](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_ILockable_Unlock.htm.md) methods to provide thread safety. You need call these methods manually only if you manipulate the objects manually, or if you inherit your own class from [ILockable](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_ILockable.htm.md) interface.
   
## See Also

### Reference

- [ILockable Interface](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_ILockable.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
