SetThreadGroupID

Changes the thread group ID of the running thread

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

Syntax

  #include <nwthread.h> 
    
  int SetThreadGroupID  (  
     int   newThreadGroupID); 
  

Parameters

newThreadGroupID
(IN) Specifies the ID of the thread group to make current (returned by a previous call to SetThreadGroupID or GetThreadGroupID.

Return Values

This function returns the ID of the previously current thread group if successful. Otherwise, it returns EFAILURE and sets errno to:

Value

Hex

Name

Description

22

(0x16)

EBADHNDL

Invalid thread group ID was passed in.

Remarks

The SetThreadGroupID function determines which instance of the current connection, current task, current screen, and so on, is used. (See Section 1.4, Context and Thread Groups.) Since a thread group is owned by a particular NLM, this function also sets the current NLM ID to the NLM that owns the thread group that is being made current.

NOTE:A library should save and restore the thread group ID whenever it changes the current thread group.

See Also

GetThreadGroupID, SetNLMID

Example

  #include <nwthread.h>  
   
  int   currentThreadGroupID;  
  int   newThreadGroupID;  
  currentThreadGroupID = SetThreadGroupID (newThreadGroupID);