-
Committer:
Laurynas Biveinis
-
Date:
2011-06-01 07:07:54 UTC
-
Revision ID:
laurynas.biveinis@percona.com-20110601070754-oms0swfizqcgk0z8
Fix race condition if the thread pool is used.
libevent_add_connection adds a thd to the libevent processing queue,
releases the LOCK_thread_count mutex, and then sets a field in the
thd. Since other thread pool threads get a chance to run and process
this thd after the LOCK_thread_count release, it is possible that they
fully process the request and destroy the thd before the current
thread can set the field in libevent_add_connection. The fix is to
protect field initialization by the same mutex too.