libpcp + apps: move conditional context locking inside libpcp
commita35c3b1f2c35037be6731e755be32566c25b7ff6
authorKen McDonell <kenj@internode.on.net>
Wed, 19 Jul 2017 10:52:21 +0000 (19 20:52 +1000)
committerKen McDonell <kenj@internode.on.net>
Wed, 19 Jul 2017 10:52:21 +0000 (19 20:52 +1000)
tree0e697581cb2c2bc181c10224ba87f031e315efe5
parent570efaa66eb93cc2e7273a8bbacbfa050228255d
libpcp + apps: move conditional context locking inside libpcp

__pmLogFetch() and __pmLogRead_ctx() will now lock and unlock the
current context if it is not already locked ... this is only possible
now that context locks are not recursive.

This allowed us to remove the PM_LOCK()/PM_UNLOCK() operations above
the PMAPI for pmlogdump, pmlogcheck and pmlogrewrite.

All of this as per Dave's suggestion in a recent review.
src/libpcp/src/logutil.c
src/pmdumplog/pmdumplog.c
src/pmlogcheck/pass3.c
src/pmlogrewrite/pmlogrewrite.c