Author: jplevyak
Date: Sun Sep 11 23:34:21 2011
New Revision: 1169583

URL: http://svn.apache.org/viewvc?rev=1169583&view=rev
Log:
TS-947: race condition in AIO: this fix prevents soft lock by checking the
atomic queue every 10 msecs to see if anything was inserted w/o the lock.

Modified:
    trafficserver/traffic/trunk/iocore/aio/AIO.cc

Modified: trafficserver/traffic/trunk/iocore/aio/AIO.cc
URL: 
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/aio/AIO.cc?rev=1169583&r1=1169582&r2=1169583&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/aio/AIO.cc (original)
+++ trafficserver/traffic/trunk/iocore/aio/AIO.cc Sun Sep 11 23:34:21 2011
@@ -528,7 +528,9 @@ aio_thread_main(void *arg)
         op->thread->schedule_imm_signal(op);
       ink_mutex_acquire(&my_aio_req->aio_mutex);
     } while (1);
-    ink_cond_wait(&my_aio_req->aio_cond, &my_aio_req->aio_mutex);
+    timespec ten_msec_timespec = ink_based_hrtime_to_timespec(ink_get_hrtime() 
+ HRTIME_MSECONDS(10));
+    ink_cond_timedwait(&my_aio_req->aio_cond, &my_aio_req->aio_mutex,
+                       &ten_msec_timespec);
   }
   return 0;
 }


Reply via email to