From 8ea0daa2917cbfa42e1e1d0ac861abc931860b68 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Mon, 7 Nov 2011 12:38:43 +0100 Subject: [mnesia] Fix deadlock in aborted mnesia:del_table_copy/2 --- lib/mnesia/src/mnesia_schema.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/mnesia/src') diff --git a/lib/mnesia/src/mnesia_schema.erl b/lib/mnesia/src/mnesia_schema.erl index f533fa5463..179e15197e 100644 --- a/lib/mnesia/src/mnesia_schema.erl +++ b/lib/mnesia/src/mnesia_schema.erl @@ -2373,11 +2373,12 @@ undo_prepare_op(Tid, {op, add_table_copy, Storage, Node, TabDef}) -> undo_prepare_op(_Tid, {op, del_table_copy, _, Node, TabDef}) when Node == node() -> + WriteLocker = get(mnesia_lock), + WriteLocker =/= undefined andalso (WriteLocker ! die), Cs = list2cs(TabDef), Tab = Cs#cstruct.name, mnesia_lib:set({Tab, where_to_read}, Node); - undo_prepare_op(_Tid, {op, change_table_copy_type, N, FromS, ToS, TabDef}) when N == node() -> Cs = list2cs(TabDef), -- cgit v1.2.3