Pike v8.0 release 1738

Method Thread.Farm()->set_thread_name_cb()


Method set_thread_name_cb

void set_thread_name_cb(function(object, string:void) cb, void|string prefix)

Description

Provide a callback function to track names of threads created by the farm.

Parameter cb

The callback function. This will get invoked with the thread as the first parameter and the name as the second whenever a thread is created. When the same thread terminates the callback is invoked again with 0 as the second parameter. Set cb to 0 to stop any previously registered callbacks from being called.

Parameter prefix

An optional name prefix to distinguish different farms. If not given a prefix will be generated automatically.