And even if it would be multi threaded it won't work. Every time
store_visits methods is executed new mutex is created, so there won't
be synchronization.

> Thin runs in a single thread, no need for a mutex there.

> >    def store_visits
> >      begin
> >        mutex = Mutex.new
> >        mutex.lock
> >        $visits.each do |env|
> >          SiteTracker.create(
> >            :user_agent => env['HTTP_USER_AGENT'],
> >            :language => env['HTTP_ACCEPT_LANGUAGE'],
> >            :path => env['PATH_INFO'],
> >            :ip => env['REMOTE_ADDR'],
> >            :referer => env['HTTP_REFERER']
> >          )
> >        end
> >        open(File.dirname(__FILE__)+'/last_update','w'){|f| f.puts
> > Time.now.to_s}
> >        mutex.unlock
> >      rescue => e
> >        RAILS_ENV == 'production' ? logger.info(e) : logger.debug(e)
> >      ensure
> >        mutex.unlock
> >      end
> >    end
> >


-- 
Radosw Bu„Šat

http://radarek.jogger.pl - m blog