aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mnesia/src/mnesia.erl
diff options
context:
space:
mode:
authorUlf Wiger <[email protected]>2010-12-09 18:14:15 +0100
committerHenrik Nord <[email protected]>2011-05-16 11:00:28 +0200
commit38eef7af0f8bc1d2d152cefb8df1e1303ddcac45 (patch)
treed9c59098037eafa221a08efaa085933e8915c127 /lib/mnesia/src/mnesia.erl
parent6d446fc5d08d56174a79ab546d5aa2e79277af06 (diff)
downloadotp-38eef7af0f8bc1d2d152cefb8df1e1303ddcac45.tar.gz
otp-38eef7af0f8bc1d2d152cefb8df1e1303ddcac45.tar.bz2
otp-38eef7af0f8bc1d2d152cefb8df1e1303ddcac45.zip
Write locks now check majority when needed.
Since the table loader also sets (table) write locks, a special lock type, 'load', was needed. Unfortunately, this affects mnesia activity callbacks that redefine the lock operation.
Diffstat (limited to 'lib/mnesia/src/mnesia.erl')
-rw-r--r--lib/mnesia/src/mnesia.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/mnesia/src/mnesia.erl b/lib/mnesia/src/mnesia.erl
index 025b32f506..43953f9ad4 100644
--- a/lib/mnesia/src/mnesia.erl
+++ b/lib/mnesia/src/mnesia.erl
@@ -39,6 +39,7 @@
%% Access within an activity - Lock acquisition
lock/2, lock/4,
+ lock_table/2,
read_lock_table/1,
write_lock_table/1,
@@ -415,6 +416,9 @@ lock(LockItem, LockKind) ->
abort(no_transaction)
end.
+lock_table(Tab, LockKind) ->
+ lock({table, Tab}, LockKind).
+
lock(Tid, Ts, LockItem, LockKind) ->
case element(1, Tid) of
tid ->
@@ -467,6 +471,8 @@ lock_table(Tid, Ts, Tab, LockKind) when is_atom(Tab) ->
mnesia_locker:rlock_table(Tid, Store, Tab);
write ->
mnesia_locker:wlock_table(Tid, Store, Tab);
+ load ->
+ mnesia_locker:load_lock_table(Tid, Store, Tab);
sticky_write ->
mnesia_locker:sticky_wlock_table(Tid, Store, Tab);
none ->