SuspendThread

Prevents a specified thread in the NLM from being scheduled

Local Servers:blocking
Remote Servers:N/A
Classification:3.x, 4.x, 5.x, 6.x
Service:Thread

Syntax

  #include <nwthread.h>  
   
  int SuspendThread  (  
     int   threadID); 
  

Parameters

threadID
(IN) Specifies the ID of the thread to be suspended.

Return Values

The following table lists return values and descriptions.

Value

Hex

Name

Description

0

(0x00)

ESUCCESS

Thread was suspended.

22

(0x16)

EBADHNDL

A bad thread ID was passed in.

Remarks

This function causes a specified thread to be suspended. ResumeThread makes the thread runnable once again.

SuspendThread maintains a count of the number of times a thread is suspended. An equal number of calls to ResumeThread must be performed for the thread to run again. This allows calls to SuspendThread and ResumeThread to be nested.

Blocking Information SuspendThread does not block when suspending other threads, but blocks when suspending itself.

See Also

EnterCritSec, ResumeThread