# Sandbox.ThreadSafe.AssertIsNotMainThread

```csharp
static void AssertIsNotMainThread()
```

Throws an exception if called from the main thread.
Useful for enforcing that blocking operations don't run on the main thread.

### Exceptions

- `System.Exception`: Thrown if on the main thread

Declared in [Sandbox.ThreadSafe](/api/Sandbox.ThreadSafe).
Assembly: `Sandbox.System`.
