[erlang-questions] enif_get_resource and reference counting

John Doe donpedrothird@REDACTED
Sat Jan 9 07:12:19 CET 2016


Hi,
Does successful call of enif_get_resource increase reference counter on a
resource, like  enif_keep_resource does?
Or It is neccessary to do
enif_get_resource(...);
enif_keep_resource(...);
...some job...
enif_release_resource(...);

And if it does not increment the counter, can the resource become destroyed
in the another thread between calls to enif_get_resource and
enif_keep_resource?
I'm afraid of race condition there.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160109/29541af2/attachment.htm>


More information about the erlang-questions mailing list