cpp version:

* add wrappers for pthread_rwlock_t, pthread_mutex_t and pthread_spinlock_t
* lookup() prototype fix