#include <IOKit/IOCommandGate.h>
#include <IOKit/IOService.h>
#include <IOKit/IOWorkLoop.h>
+#include <libkern/c++/OSPtr.h>
/*!
* @class IOCommandPool
queue_head_t fQueueHead; /* head of the queue of elements available */
UInt32 fSleepers; /* Count of threads sleeping on this pool */
- IOCommandGate *fSerializer; /* command gate used for serializing pool access */
+ OSPtr<IOCommandGate> fSerializer; /* command gate used for serializing pool access */
/*! @struct ExpansionData
* @discussion This structure will be used to expand the capablilties of the IOEventSource in the future.
* otherwise NULL.
*/
- static IOCommandPool *withWorkLoop(IOWorkLoop *inWorkLoop);
+ static OSPtr<IOCommandPool> withWorkLoop(IOWorkLoop *inWorkLoop);
/*!
* @function init
* @function withWorkLoop
* @abstract Should never be used, obsolete. See IOCommandPool::withWorkLoop.
*/
- static IOCommandPool *commandPool(IOService *inOwner,
+ static OSPtr<IOCommandPool> commandPool(IOService *inOwner,
IOWorkLoop *inWorkLoop,
UInt32 inSize = kIOCommandPoolDefaultSize);
* pointer was returned.
*/
- virtual IOCommand *getCommand(bool blockForCommand = true);
+ virtual OSPtr<IOCommand> getCommand(
+ bool blockForCommand = true);
/*!
* @function returnCommand
* The command to place in the pool.
*/
- virtual void returnCommand(IOCommand *command);
+ virtual void returnCommand(LIBKERN_CONSUMED IOCommand *command);
protected: