uwiger / gproc

Extended process registry for Erlang
Apache License 2.0
1.07k stars 232 forks source link

Can't reset a shared counter #156

Open hommeabeil opened 6 years ago

hommeabeil commented 6 years ago

It seems to be impossible to reset a shared counter with the function gproc:reset_counter/1. By looking at the source code, you seems to used the self() in the ETS key. In the case of shared counter I do not think the self() is part of the key...

If I do the same operation as in the module (read and write) then everything works as expected.

This is the relevent stack trace information:


    [{ets,lookup_element,[gproc,{{c,l,time_used},<0.1144.0>},3],[]},
     {gproc,reset_counter1,1,
         [{file,
              "c:/dev/Genetec.Plugins.Snmp.Gateway/_build/default/lib/gproc/src/gproc.erl"},
          {line,1828}]},
     {gproc,reset_counter,1,
         [{file,
              "c:/dev/Genetec.Plugins.Snmp.Gateway/_build/default/lib/gproc/src/gproc.erl"},
          {line,1819}]},```