Compartir a través de


Implementing Pending Operations

If your Online or Offline entry point functions require more than 300 milliseconds, it is recommended that you use a worker thread to perform the operation asynchronously.

The following steps are all required:

To Implement a Pending Operation

  1. In your Online or Offline entry point function, call ClusWorkerCreate to start a worker thread and return ERROR_IO_PENDING immediately.
  2. Have the thread perform the necessary online or offline tasks.
  3. Periodically call ClusWorkerCheckTerminate to see if the Terminate entry point function has been called.
  4. Use the SetResourceStatus function pointer obtained from the Startup entry point function to report status information to the Resource Monitor.

If the resource does not transition within the time specified by the resource's PendingTimeout property, the Resource Monitor calls the Terminate entry point function.

Example

See Resource DLL Examples.