- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xotcl::THREAD
::xotcl::THREADcreate ... \
[ -exithandler (default "ns_log notice "EXITHANDLER of slave thread SELF [pid]"") ] \
[ -lightweight (default "0") ] \
[ -persistent (default "0") ]
Defined in
Class Relations
::xotcl::Class create ::xotcl::THREAD \ -superclass ::xotcl::ObjectMethods (to be applied on the object)
recreate (scripted, private)
xotcl::THREADrecreate obj args [ args... ]
this method catches recreation of THREADs in worker threads it reinitializes the thread according to the new definition.
- Parameters:
- obj (required)
- args (required)
- Testcases:
- No testcase defined.
:log "recreating [self] $obj, tid [$obj exists tid]" if {![string match "::*" $obj]} { set obj ::$obj } $obj set recreate 1 next $obj init [lindex $args 0] if {[nsv_exists [self] $obj] && [$obj exists initcmd]} { set tid [nsv_get [self] $obj] ::thread::send $tid [$obj set initcmd] $obj set tid $tid :log "+++ content of thread $obj ($tid) redefined" }shutdown (scripted, private)
xotcl::THREADshutdown registry obj tid
Compatibility entry point for already registered shutdown callbacks.
- Parameters:
- registry (required)
- shared thread registry
- obj (required)
- thread controller name
- tid (required)
- registered worker identifier
- Testcases:
- No testcase defined.
::xo::thread_shutdown $registry $obj $tidMethods (to be applied on instances)
destroy (scripted)
<instance of xotcl::THREAD> destroy
:log "destroy called" if {!${:persistent} && [nsv_exists [self class] [self]]} { set tid [nsv_get [self class] [self]] set refcount [::thread::release $tid] :log "destroying thread object tid=$tid cnt=$refcount" if {$refcount == 0} { :log "thread terminated" nsv_unset [self class] [self] ns_mutex destroy ${:mutex} ns_log notice "mutex ${:mutex} destroyed" } } next
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
![[i]](/resources/acs-subsite/ZoomIn16.gif)