Index: openacs-4/packages/xotcl-core/tcl/bgdelivery-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/bgdelivery-procs.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/xotcl-core/tcl/bgdelivery-procs.tcl 4 Nov 2008 20:11:31 -0000 1.16 +++ openacs-4/packages/xotcl-core/tcl/bgdelivery-procs.tcl 4 Nov 2008 22:04:49 -0000 1.17 @@ -224,10 +224,15 @@ catch { set ch [ns_conn channel] - thread::transfer $tid $ch + if {[catch {thread::transfer $tid $ch} innerError]} { + set channels_in_use "??" + catch {set channels_in_use [bgdelivery do file channels]} + ns_log error "thread transfer failed, channel=$ch, channels_in_use=$channels_in_use" + error $innerError + } } errorMsg - ::thread::mutex unlock [my set mutex] + ::thread::mutex unlock [my set mutex] #ns_mutex unlock [my set bgmutex] # my log "+++ unlock [my set bgmutex]"