Mac Developer Library

Developer

IOCommandPool Class Reference

Options
Deployment Target:

On This Page
Language:

IOCommandPool

Manipulates a pool of commands which inherit from IOCommand. More...

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable @import Kernel;

Availability


Available in OS X v10.6 and later.
  • Should never be used, obsolete. See IOCommandPool::withWorkLoop.

    Declaration

    C++

    static IOCommandPool *commandPool( IOService *inOwner, IOWorkLoop *inWorkLoop, UInt32 inSize = kIOCommandPoolDefaultSize);

    Import Statement

  • Declaration

    C++

    virtual IOReturn gatedGetCommand( IOCommand **vCommand, boolvBlock);

    Parameters

    vCommand

    A pointer to a pointer to an IOCommand object where the returned command will be stored.

    vBlock

    A bool that indicates whether to block the request until a command becomes available.

    Return Value

    Returns kIOReturnNoResources if no command is available and the client doesn't wish to block until one does become available. kIOReturnSuccess if the vCommand argument is valid.

    Discussion

    The gatedGetCommand method is used to serialize the extraction of a command from the pool behind a command gate, runAction-ed by getCommand.

    Import Statement

  • Declaration

    C++

    virtual IOReturn gatedReturnCommand( IOCommand *vCommand);

    Parameters

    vCommand

    A pointer to the IOCommand object to be returned to the pool.

    Return Value

    Always returns kIOReturnSuccess if the vCommand argument is valid.

    Discussion

    The gatedReturnCommand method is used to serialize the return of a command to the pool behind a command gate, runAction-ed by returnCommand.

    Import Statement

  • Declaration

    C++

    virtual IOCommand *getCommand( bool blockForCommand = true);

    Parameters

    blockForCommand

    If the caller would like to have its thread slept until a command is available, it should pass true, else false.

    Return Value

    If the caller passes true in blockForCommand, getCommand guarantees that the result will be a pointer to an IOCommand object from the pool. If the caller passes false, s/he is responsible for checking whether a non-NULL pointer was returned.

    Discussion

    The getCommand method is used to get a pointer to an object of type IOCommand from the pool.

    Import Statement

  • Should never be used, obsolete. See initWithWorkLoop.

    Declaration

    C++

    virtual bool init( IOService *inOwner, IOWorkLoop *inWorkLoop, UInt32 inSize = kIOCommandPoolDefaultSize);

    Import Statement

  • Primary initializer for an IOCommandPool object.

    Declaration

    C++

    virtual bool initWithWorkLoop( IOWorkLoop *inWorkLoop);

    Parameters

    inWorkLoop

    The workloop that this command pool should synchronize with.

    Return Value

    Returns true if command pool was successfully initialized.

    Discussion

    Primary initializer for an IOCommandPool. Should probably use IOCommandPool::withWorkLoop() as it is easier to use.

    Import Statement

  • Declaration

    C++

    virtual void returnCommand( IOCommand *commmand);

    Parameters

    commmand

    The command to place in the pool.

    Discussion

    The returnCommand method is used to place an object of type IOCommand into the pool, whether it be the first time, or the 1000th time.

    Import Statement

  • Should never be used, obsolete. See IOCommandPool::withWorkLoop.

    Declaration

    C++

    static IOCommandPool *commandPool( IOService *inOwner, IOWorkLoop *inWorkLoop, UInt32 inSize = kIOCommandPoolDefaultSize);

    Import Statement

  • Primary factory method for the IOCommandPool class

    Declaration

    C++

    static IOCommandPool *withWorkLoop( IOWorkLoop *inWorkLoop);

    Parameters

    inWorkLoop

    The workloop that this command pool should synchronize with.

    Return Value

    Returns a pointer to an instance of IOCommandPool if successful, otherwise NULL.

    Discussion

    The withWorkLoop method is what is known as a factory method. It creates a new instance of an IOCommandPool and returns a pointer to that object.

    Import Statement

Constants

  • kIOCommandPoolDefaultSize

    kIOCommandPoolDefaultSize

    The default size of any command pool.

    kIOCommandPoolDefaultSize is the default size of any command pool. The default size was determined to be the smallest size for which a pool makes sense.

  • Data Types

    • Declaration

      C++

      struct ExpansionData { };

      Discussion

      This structure will be used to expand the capablilties of the IOEventSource in the future.

    Instance Variables

    • Reserved for future use. (Internal use only)

      Declaration

      C++

      ExpansionData *reserved;