def create_thread(*args)
      return if pool_closed?
      thread = nil
      @lock.synchronize do
        if(args.include?(:nowait) || action_size > size || action_size > waiting || args.include?(:force))
          if(size < max || args.include?(:force))
            thread = ActionPool::Thread.new(:pool => self, :respond_thread => @respond_to,
              :a_timeout => @action_timeout, :t_timeout => @thread_timeout, :logger => @logger,
              :autostart => false)
            @threads << thread
          end
        end
        if(((size == working || args.include?(:nowait)) && @threads.size < @max_threads) || args.include?(:force))

        end
      end
      thread.start if thread
      thread
    end
def create_thread(*args)
      return if pool_closed?
      thread = nil
      @lock.synchronize do
        if(args.include?(:nowait) || action_size > size || action_size > waiting || args.include?(:force))
          if(size < max || args.include?(:force))
            thread = ActionPool::Thread.new(:pool => self, :respond_thread => @respond_to,
              :a_timeout => @action_timeout, :t_timeout => @thread_timeout, :logger => @logger,
              :autostart => false)
            @threads << thread
          end
        end
        if(((size == working || args.include?(:nowait)) && @threads.size < @max_threads) || args.include?(:force))

        end
      end
      thread.start if thread
      thread
    end
args::  :force forces a new thread.
       :nowait will create a thread if threads are waiting
 Create a new thread for pool.
 Returns newly created thread or nil if pool is at maximum size