Fixed case when waiter is the same process as one being registered #7

wants to merge 1 commit into


None yet

2 participants

idubrov commented Jul 11, 2011

Consider the following commands given in the shell:

gproc:nb_wait({n, l, somekey}).
gproc:reg({n, l, somekey}).
gproc:unreg({n, l, somekey}).

This will fail, because gproc:maybe_waiters firstly inserts key in the ETS ({{<0.43.0>,{n,l,somekey}},r}), then invokes notify_waiters which in turn removes the same row from the ETS (since the waiting and registering processes are the same). The patch simply changes the order of two invocations. Firstly it notifies the waiters, then it inserts the row into the ETS.

uwiger commented Jul 20, 2011

Thanks. I have implemented a slightly different fix in

I keep the esl version more current, and only occasionally push to the uwiger version.

@uwiger uwiger closed this Jul 20, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment