liblock: use macro to make tests simpler

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
liblock: split the public headers

First step in adding more locking types.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
liblock: link with pthread for test code

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
liblock: timeout for test code

So the purpose of the test code is to trigger deadlocks, and it does
just that. We need a timeout to exit from the test once we're
deadlocked.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
liblock: add support for rwlocks

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
liblock: add missing includes to common object

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
liblock: steal a much better makefile from tools/lib/traceevent/

No need to reinvent the wheel here.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>