|
From: Dmitry Y. <di...@us...> - 2007-11-30 10:23:44
|
Build Version : T2.1.0.17402 Firebird 2.1 Beta 2 (writeBuildNum.sh,v 1.17560 2007/11/30 10:23:44 dimitr Exp ) Update of /cvsroot/firebird/firebird2/src/lock In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv5851 Modified Files: Tag: B3_0_Transition lock.cpp Log Message: Let's always call ctor/dtor for objects even if they can be reused at the binary level (inside not time-critical paths, of course). Index: lock.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/lock/lock.cpp,v retrieving revision 1.121.2.26 retrieving revision 1.121.2.27 diff -b -U3 -r1.121.2.26 -r1.121.2.27 --- lock.cpp 30 Nov 2007 06:39:40 -0000 1.121.2.26 +++ lock.cpp 30 Nov 2007 10:23:43 -0000 1.121.2.27 @@ -182,7 +182,7 @@ static void grant(LRQ, LBL); static SRQ_PTR grant_or_que(LRQ, LBL, SSHORT); static bool init_lock_table(ISC_STATUS *); -static void init_owner_block(own*, UCHAR, LOCK_OWNER_T, bool); +static void init_owner_block(own*, UCHAR, LOCK_OWNER_T); static void lock_initialize(void*, SH_MEM, bool); static void insert_data_que(LBL); static void insert_tail(SRQ, SRQ); @@ -1756,7 +1756,6 @@ /* Allocate an owner block */ own* owner = 0; - bool new_block; if (SRQ_EMPTY(LOCK_header->lhb_free_owners)) { if (!(owner = (own*) alloc(sizeof(own), status_vector))) @@ -1764,17 +1763,15 @@ release_mutex(); return false; } - new_block = true; } else { owner = (own*) ((UCHAR *) SRQ_NEXT(LOCK_header->lhb_free_owners) - OFFSET(own*, own_lhb_owners)); remove_que(&owner->own_lhb_owners); - new_block = false; } - init_owner_block(owner, owner_type, owner_id, new_block); + init_owner_block(owner, owner_type, owner_id); /* cannot ASSERT_ACQUIRED; here - owner not setup */ insert_tail(&LOCK_header->lhb_owners, &owner->own_lhb_owners); @@ -2466,8 +2463,7 @@ static void init_owner_block(own* owner, UCHAR owner_type, - LOCK_OWNER_T owner_id, - bool new_block) + LOCK_OWNER_T owner_id) { /************************************** * @@ -2494,8 +2490,6 @@ owner->own_process_id = LOCK_pid; owner->own_acquire_time = 0; - if (new_block) - { #ifdef USE_BLOCKING_THREAD ISC_event_init(owner->own_blocking, 0, BLOCKING_SIGNAL); #endif @@ -2503,18 +2497,6 @@ ISC_event_init(owner->own_stall, 0, STALL_SIGNAL); #endif ISC_event_init(owner->own_wakeup, 0, WAKEUP_SIGNAL); - } -#if defined(WIN_NT) && !defined(SUPERSERVER) - else - { - // On Windows CS, we cannot simply reuse the existing event objects. - // Instead, we release them in purge_owner() and then recreate them here. -#ifdef USE_BLOCKING_THREAD - ISC_event_init(owner->own_blocking, 0, BLOCKING_SIGNAL); -#endif - ISC_event_init(owner->own_wakeup, 0, WAKEUP_SIGNAL); - } -#endif } @@ -3037,12 +3019,13 @@ owner->own_process_id = 0; owner->own_flags = 0; -#if defined(WIN_NT) && !defined(SUPERSERVER) #ifdef USE_BLOCKING_THREAD ISC_event_fini(owner->own_blocking); #endif - ISC_event_fini(owner->own_wakeup); +#ifdef PREVENT_OWNER_STARVATION + ISC_event_fini(owner->own_stall); #endif + ISC_event_fini(owner->own_wakeup); } |