srv_terminatethread

Disconnects and exits the client thread associated with the SRV_PROC structure.


Important This Open Data Services function or macro is only supported in Microsoft® SQL Server™ version 7.0 for backward compatibility.


For more information about Open Data Services functions or macros supported for backward compatibility, see Open Data Services (Level 3).

Syntax

srv_terminatethread ( SRV_PROC * srvproc );

Arguments
srvproc
Is a pointer to the Open Data Services thread to terminate. The structure parameter contains information the ODS Library uses to manage communication and data between the application and the client.
Returns

SUCCEED or FAIL.

Remarks

By passing in the srvproc pointer that refers to a thread, this function can be used to kill any thread executing a user request from anywhere in your Open Data Services server application. To use srv_terminatethread to kill a thread other than the one executing the current client request, the application must provide a way of tracking active threads and referring to them by using the srvproc pointer. For example, if the application implements its own monitoring thread to determine the status of an active thread, the monitoring thread can use srv_terminatethread to terminate that thread.

The srv_terminatethread function does not terminate the thread immediately. When you issue the srv_terminatethread function, it sets an appropriate status in the SRV_PROC structure that instructs the client to clean up and exit. Open Data Services checks the SRV_PROC structure for termination status at common entry points and, if present, activates exit processing. If the client thread is currently processing an event, it continues processing and waits until the event handler issues a return before exiting.

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.