Fixed threading.jl. Added maxthreads().
Fix freeze in the barrier (when threads aren't forked).