nxCancelDisable

Protects the calling thread from being cancelled until nxCancelEnable is called.

Library:LibC
Classification:Novell
Service:NetWare Platform

Syntax

  #include <nks/netware.h>
   
  void nxCancelDisable ( void );
  

Remarks

When cancellation is enabled, the library performs cancellation at many points in its functions. By default, cancellation is enabled for an NLMâ„¢ application.

The nxCancelDisable function permits explicit cancellation-point management. A cancellation point is any point at which a thread might be suspended or killed. Many of the library's functions offer cancellation points upon entry and exit to or from the function. If a thread is holding a lock or other resource on which other threads might depend or wait, it must not be allowed to be cancelled by the library.

On NetWare, an application can call outside NKS into another library or service and acquire resources (especially locks) that are unknown to the library. It is probably best not to permit the library to kill or suspend the thread while it holds these resources.

The nxCancelEnable and nxCancelDisable functions work recursively so that you can call to disable cancellation in successively deeper functions, but each call to nxCancelDisable must be matched by a later call to nxCancelEnable. Too many enable calls will not falsify the counter because it stops at zero.

See Also