this should be in clock.h or maybe pithreads.h  but then there is maybe a circular declaration issue (with channel.h)