<div dir="ltr">I'm afraid of the situation when the only resource owner is killed and resource must be destroyed by calling destructor.<div><br></div><div>It is too late to call to erlang at this time =(</div><div><br></div><div>However, your idea is interesting.  I can register some destruction manager just like a "hier" in ets and when resource is going to be killed, or its owner is going to be killed, we send a message to the "destruction manager" and it will clean without these messy cond_wait_timeout calls.</div></div>