xotcl::THREAD instproc destroy (public)

 <instance of xotcl::THREAD[i]> destroy

Defined in /var/www/openacs/packages/xotcl-core/tcl/40-thread-mod-procs.tcl

Destroy the thread controller and release its worker if it is nonpersistent. Persistent workers are managed by the shutdown callback.

Testcases:
thread_destroy_after_cache_cleanup
Source code:
: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
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: