[Devel] dbt_lib.c:dbt_db_del_table(): should we release the lock of
_tbc->sem when break ?
yanlin
yanlin at fortinet.com
Mon May 21 10:13:15 CEST 2007
hi, all,
in function dbt_db_del_table() of module dbtext, should we do "lock_release(&_tbc->sem)" before "break" when
we found the cached table for delete? in tbl_cache_free(), "lock_get(&_tbc->sem)" would be called, deadlock then.
int dbt_db_del_table(dbt_cache_p _dc, str *_s)
{
...
while(_tbc)
{
...
lock_get(&_tbc->sem);
if(_tbc->dtp->name.len == _s->len
&& !strncasecmp(_tbc->dtp->name.s, _s->s, _s->len))
{
...
//============> need 'lock_release(&_tbc->sem)' before break ?
break;
}
lock_release(&_tbc->sem);
...
}
...
tbl_cache_free(_tbc);
...
}
regards,
yan lin
05/21/2007
*** Disclaimer: This message may contain privileged and/or confidential information. If you have received this e-mail in error or are not the intended recipient, you may not use, copy, disseminate or distribute it; do not open any attachments, delete it immediately from your system and notify the sender promptly by e-mail that you have done so. Thank you. ***
More information about the Devel
mailing list