~vinchen13/mysql-proxy/fix_some_bugs

Viewing all changes in revision 4.

  • Committer: vin
  • Date: 2012-02-15 07:36:42 UTC
  • Revision ID: vinchen13@gmail.com-20120215073642-qd1lm33hmjcu56fz
fix the potential concurrent problems in chassis_private->cons

  chassis_private->cons is a GPtrArray, and it's not thread-safe. But all the event thread can add or remove connections at one time. So it should have some concurrent protection while adding or removing connections. So, add one mutex to protect chassis_private->cons.
  By the way, maybe add a connection would not have the concurrent problems, because only the main thread can do it. For security, all the global variable shoule be protected when visiting. 

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: