SetCurrentTask

Sets the calling thread group’s current task number

Local Servers:nonblocking
Remote Servers:nonblocking
Classification:3.x, 4.x, 5.x, 6.x
Service:Connection Number and Task Management

Syntax

  #include <nwcntask.h>  
   
  LONG SetCurrentTask  (  
     LONG   taskNumber); 
  

Parameters

taskNumber
(IN) Specifies the task number to set.

Return Values

This function returns the old current task number if successful. Otherwise, it returns EFAILURE.

Remarks

This function sets the current task number for the thread group. If the taskNumber parameter is -1, a new task number is allocated. If the taskNumber parameter is not -1, the current task is set to that value.

Call SetCurrentTask if the NLM needs to allocate only one task number for the current connection number. If more than one task number is needed, call AllocateBlockOfTasks.

See Also

AllocateBlockOfTasks, GetCurrentTask, ReturnBlockOfTasks