我启动 gen_fsm:
start_link() ->
gen_fsm:start_link({global, ?MODULE}, [],
[]).
我怎样才能得到它的PID?
谢谢你。
如果您检查文档,gen_fsm:start_link/3
您会看到它返回{ok, Pid}
.
You can either get it as the result of gen_fsm:start_link/3 or since it is a registered process using whereis(nameofprocess).