aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/compilation_SUITE_data/on_load_inline.erl
blob: 322843b61eeec083ec208502dbdff2eff75cfcc3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-module(on_load_inline).
-export([?MODULE/0]).
-on_load(on_load/0).
-compile(inline).

?MODULE() ->
    [{pid,Pid}] = ets:lookup(on_load_executed, pid),
    exit(Pid, kill),
    ok.

on_load() ->
    Parent = self(),
    spawn(fun() ->
		  T = ets:new(on_load_executed, [named_table]),
		  ets:insert(T, {pid,self()}),
		  Parent ! done,
		  receive
		      wait_forever -> ok
		  end
	  end),
    receive
	done -> ok
    end.