Browse Source

ckdb - demote shift_rewards payouts lock to read - no payout data is changed

master
kanoi 9 years ago
parent
commit
20d53cad15
  1. 2
      src/ckdb.h
  2. 4
      src/ckdb_data.c

2
src/ckdb.h

@ -55,7 +55,7 @@
#define DB_VLOCK "1" #define DB_VLOCK "1"
#define DB_VERSION "1.0.2" #define DB_VERSION "1.0.2"
#define CKDB_VERSION DB_VERSION"-1.230" #define CKDB_VERSION DB_VERSION"-1.231"
#define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__ #define WHERE_FFL_HERE __FILE__, __func__, __LINE__

4
src/ckdb_data.c

@ -4682,7 +4682,7 @@ bool shift_rewards(K_ITEM *wm_item)
DATA_WORKMARKERS(wm, wm_item); DATA_WORKMARKERS(wm, wm_item);
// Deadlock risk since calling code should have workmarkers locked // Deadlock risk since calling code should have workmarkers locked
K_WLOCK(payouts_free); K_RLOCK(payouts_free);
p_item = find_payouts_wid(wm->workinfoidend, ctx); p_item = find_payouts_wid(wm->workinfoidend, ctx);
DATA_PAYOUTS_NULL(payouts, p_item); DATA_PAYOUTS_NULL(payouts, p_item);
// a workmarker should not cross a payout boundary // a workmarker should not cross a payout boundary
@ -4693,7 +4693,7 @@ bool shift_rewards(K_ITEM *wm_item)
p_item = prev_in_ktree(ctx); p_item = prev_in_ktree(ctx);
DATA_PAYOUTS_NULL(payouts, p_item); DATA_PAYOUTS_NULL(payouts, p_item);
} }
K_WUNLOCK(payouts_free); K_RUNLOCK(payouts_free);
wm->rewards = rewards; wm->rewards = rewards;
return (rewards > 0); return (rewards > 0);

Loading…
Cancel
Save