aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/test/cover_SUITE_data/f.erl
blob: a29a67b3885280a0e579eed6fc8ede17ba747d53 (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
24
-module(f).
-export([f1/0,f2/0,call_f2_when_isolated/0]).

f1() ->
    f1_line1,
    f1_line2.

f2() ->
    f2_line1,
    f2_line2.

call_f2_when_isolated() ->
    [Other] = nodes(),
    net_kernel:disconnect(Other),
    do_call_f2_when_isolated().

do_call_f2_when_isolated() ->
    case nodes() of
	[] ->
	    f2();
	_ ->
	    timer:sleep(100),
	    do_call_f2_when_isolated()
    end.