3030-export ([
3131 start_link /0 ,
3232 create_ets_table /1 , create_ets_table /2 ,
33+ create_named_ets_table /2 ,
3334 delete_ets_table /1 ,
3435 change_owner /2
3536 ]).
5354-type ets_concurrency () :: none | read_only | write_only | read_and_write .
5455-export_type ([ets_concurrency / 0 ]).
5556
56- -spec start_link () -> {ok , pid ()}.
57- -spec create_ets_table (ets_concurrency ()) -> ets :tid ().
58- -spec create_ets_table (atom (), ets_concurrency ()) -> ets :tid ().
59- -spec delete_ets_table (atom () | ets :tid ()) -> ok .
60- -spec change_owner (atom () | ets :tid (), pid ()) -> ok .
57+ -spec start_link () -> {ok , pid ()}.
58+ -spec create_ets_table (ets_concurrency ()) -> ets :tid ().
59+ -spec create_ets_table (atom (), ets_concurrency ()) -> ets :tid ().
60+ -spec create_named_ets_table (atom (), ets_concurrency ()) -> ets :tid ().
61+ -spec delete_ets_table (atom () | ets :tid ()) -> ok .
62+ -spec change_owner (atom () | ets :tid (), pid ()) -> ok .
6163
6264start_link () ->
6365 gen_fsm :start_link ({local , ? SERVER }, ? MODULE , {}, []).
@@ -67,6 +69,11 @@ create_ets_table(Concurrency_Type) ->
6769 gen_fsm :sync_send_event (? SERVER , {create_ets_table , Options }).
6870
6971create_ets_table (Name , Concurrency_Type )
72+ when is_atom (Name ) ->
73+ Options = make_options (Concurrency_Type ),
74+ gen_fsm :sync_send_event (? SERVER , {create_ets_table , Name , Options }).
75+
76+ create_named_ets_table (Name , Concurrency_Type )
7077 when is_atom (Name ) ->
7178 Options = [named_table | make_options (Concurrency_Type )],
7279 gen_fsm :sync_send_event (? SERVER , {create_ets_table , Name , Options }).
0 commit comments