Added back read and write mutex to dcb. Locks are acquired in poll.c before calling call-back functions. Additional locks efficiently hide memory corruption issue, which appears when readconn router is used without using those mutexes, with multiple parallel maxscale threads and intensive load.

This commit is contained in:
vraatikka
2013-11-20 17:23:04 +02:00
parent 35d34862b9
commit a30e2ab29b
3 changed files with 39 additions and 1 deletions

View File

@ -106,6 +106,12 @@ if ((rval = calloc(1, sizeof(DCB))) == NULL)
rval->dcb_chk_tail = CHK_NUM_DCB;
#endif
rval->dcb_role = role;
#if 1
simple_mutex_init(&rval->dcb_write_lock, "DCB write mutex");
simple_mutex_init(&rval->dcb_read_lock, "DCB read mutex");
rval->dcb_write_active = false;
rval->dcb_read_active = false;
#endif
spinlock_init(&rval->dcb_initlock);
spinlock_init(&rval->writeqlock);
spinlock_init(&rval->delayqlock);