Do not race when multiple init happen at the same time
authorDavide Libenzi <dlibenzi@google.com>
Tue, 20 Oct 2015 23:34:26 +0000 (16:34 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 18 Nov 2015 17:53:32 +0000 (09:53 -0800)
commite232d656f1425df0331b94efd04ebef0732dda31
tree3de46f46487b8815667fe78ee492ba1edd6b7781
parentd9d14c2dc38879dde06218221fc0a10bc7878e24
Do not race when multiple init happen at the same time

Do not race when multiple init happen at the same time, and handle
proper cleanup when all users are gone.

Signed-off-by: Davide Libenzi <dlibenzi@google.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/profiler.c