gproc
gproc copied to clipboard
Cannot unreg_shared global property
Hi,
I have found that I can register a shared global property but cannot unregister it.
Here is what I have found in gproc_dist
:
reg_shared({_,g,_} = Key, Value, Attrs) ->
leader_call({reg, Key, Value, shared, Attrs, reg});
reg_shared(_, _, _) ->
?THROW_GPROC_ERROR(badarg).
unreg_shared({T,g,_} = Key) when T==c; T==a ->
leader_call({unreg, Key, shared});
unreg_shared(_) ->
?THROW_GPROC_ERROR(badarg).
Looks like unreg_shared
is limited to c
and a
when reg_shared
as no limitation. Is This intended?
Thanks in advance!
No, this is not intended. Nor does it make sense, of course, to allow you to register an object, but not unregister it. I note also that the documentation is wrong. There is no particular reason to restrict which types of resource can be registered as shared.