---
description: >-
  This class is used to create a mutex object that can be used to synchronize
  access to shared resources.
---

# Mutex

**Interface:**

```php
 /**
  * @return bool
  *
  * This function returns the lock status.
  */
 public function isLocked(): bool;

 /**
  * @return Generator
  *
  * This function locks the mutex.
  */
 public function lock(): Generator;

 /**
  * @return Generator
  *
  * This function unlocks the mutex.
  */
 public function unlock(): Generator;
```
