---
title: disable
framework: kernel
role: pseudoSymbol
path: kernel/iocommandgate/1811531-disable
---

# disable

Disable the command gate

## Declaration

```occ
virtual void disable(); 
```

## Overview

Overview When a command gate is disabled all future calls to runAction and runCommand will stall until the gate is enable()d later. This can be used to block client threads when a system sleep is requested. The IOWorkLoop thread itself will never stall, even when making runAction/runCommand calls. This call must be made from a gated context, to clear potential race conditions.

## See Also

### Miscellaneous

- [attemptAction](kernel/iocommandgate/1811105-attemptaction.md)
- [attemptCommand](kernel/iocommandgate/1811141-attemptcommand.md)
- [commandGate](kernel/iocommandgate/1811293-commandgate.md)
- [commandSleep(void *, AbsoluteTime, UInt32)](kernel/iocommandgate/1811482-commandsleep.md)
- [commandSleep(void *, UInt32)](kernel/iocommandgate/1811498-commandsleep.md)
- [commandWakeup](kernel/iocommandgate/1811517-commandwakeup.md)
- [enable](kernel/iocommandgate/1811547-enable.md)
- [init](kernel/iocommandgate/1811560-init.md)
- [runAction](kernel/iocommandgate/1811576-runaction.md)
- [runCommand](kernel/iocommandgate/1811585-runcommand.md)
