%3 ::xotcl::Object ::xotcl::Object ::xotcl::THREAD ::xotcl::THREAD → recreate ::xotcl::THREAD->::xotcl::Object

Class ::xotcl::THREAD

::xotcl::THREAD[i] create ... \
           [ -exithandler (default "ns_log notice "EXITHANDLER of slave thread SELF [pid]"") ] \
           [ -lightweight (default "0") ] \
           [ -persistent (default "0") ]

Defined in

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xotcl::Object[i]
::xotcl::Class create ::xotcl::THREAD \
     -superclass ::xotcl::Object

Methods (to be applied on the object)

  • recreate (scripted, private)

     xotcl::THREAD[i] recreate 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"
    }

Variables

::xotcl::THREAD set __default_metaclass ::xotcl::Class
::xotcl::THREAD set __default_superclass ::xotcl::Object