mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-06 15:10:22 -05:00
For ITS#2502 - force release of locks on exiting threads
This commit is contained in:
parent
7193d3dd21
commit
399572ba50
1 changed files with 21 additions and 1 deletions
|
|
@ -926,8 +926,28 @@ bdb_locker_id_free( void *key, void *data )
|
|||
{
|
||||
DB_ENV *env = key;
|
||||
int lockid = (int) data;
|
||||
int rc;
|
||||
|
||||
XLOCK_ID_FREE( env, lockid );
|
||||
|
||||
rc = XLOCK_ID_FREE( env, lockid );
|
||||
if ( rc == EINVAL ) {
|
||||
DB_LOCKREQ lr;
|
||||
#ifdef NEW_LOGGING
|
||||
LDAP_LOG( BACK_BDB, ERR,
|
||||
"bdb_locker_id_free: %d err %s(%d)\n",
|
||||
lockid, db_strerror(rc), rc );
|
||||
#else
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"bdb_locker_id_free: %d err %s(%d)\n",
|
||||
lockid, db_strerror(rc), rc );
|
||||
#endif
|
||||
memset( &lr, 0, sizeof(lr) );
|
||||
|
||||
/* release all locks held by this locker. */
|
||||
lr.op = DB_LOCK_PUT_ALL;
|
||||
env->lock_vec( env, lockid, 0, &lr, 1, NULL );
|
||||
XLOCK_ID_FREE( env, lockid );
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
Loading…
Reference in a new issue