Slip Ahead Logging

It's not your fault at all.

pthread の recursive mutex

pthread_mutex_t recursive_mutex_;

pthread_mutexattr_t mutex_attribute;
pthread_mutexattr_settype(&mutex_attribute, PTHREAD_MUTEX_RECURSIVE);

pthread_mutex_init(&recursive_mutex_, &mutex_attribute);

recursive mutex - hidemonの日記 という記事もあるので,本当は boost を使った方が良い.