3.5 Threads: the Threads structure

set_handler

Function

Summary

Sets a fatal signal handler for the current thread.

Signature

MLWORKS.Threads.Internal

Structure

MLWorks.Threads.Internal

Type

val set_handler : (int -> unit) -> unit

Syntax

set_handler f -> ()

Arguments

f
A function of type int -> unit.

Values

unit

Description

Makes the user-defined function f the fatal signal handler for the current thread. When a fatal signal (that is, a SIGSEGV, SIGBUS, or SIGKILL signal) is sent to the current thread, f is executed prior to the thread's termination.

The integer argument passed to f is the number of the fatal signal.

Note: A thread handler is not inherited by the thread's children. Note also that the MLWorks.Threads.Internal.kill function does not send a fatal signal.

See also

reset_fatal_status, page 58.


MLWorks Reference Manual (version 1.0) - 3 DEC 1996

Generated with Harlequin WebMaker