Fix the GPROC_POOL macro

This commit is contained in:
Feng Lee 2017-03-13 12:14:57 +08:00
parent bb91bc04c6
commit 0df59934c7
1 changed files with 4 additions and 5 deletions

View File

@ -16,19 +16,18 @@
%% Internal Header File
-define(GPROC_POOL(JoinOrLeave, Pool, I),
-define(GPROC_POOL(JoinOrLeave, Pool, Id),
(begin
case JoinOrLeave of
join -> gproc_pool:connect_worker(Pool, {Pool, I});
leave -> gproc_pool:disconnect_worker(Pool, {Pool, I})
join -> gproc_pool:connect_worker(Pool, {Pool, Id});
leave -> gproc_pool:disconnect_worker(Pool, {Pool, Id})
end
end)).
-define(PROC_NAME(M, I), (list_to_atom(lists:concat([M, "_", I])))).
-define(record_to_proplist(Def, Rec),
lists:zip(record_info(fields, Def),
tl(tuple_to_list(Rec)))).
lists:zip(record_info(fields, Def), tl(tuple_to_list(Rec)))).
-define(record_to_proplist(Def, Rec, Fields),
[{K, V} || {K, V} <- ?record_to_proplist(Def, Rec),