27 int error = pthread_mutex_lock(mutex);
30 log_error(
"Unable to lock mutex: %s", strerror(error));
37 int error = pthread_mutex_unlock(*mutex);
40 log_error(
"Unable to unlock mutex: %s", strerror(error));
Simplistic logging utilities.
#define log_error(...)
Report a condition causing the current operation to abort.
void o2s_mutex_unlock(pthread_mutex_t *const *mutex)
Unlock the mutex, logging any error.
pthread_mutex_t * o2s_mutex_lock(pthread_mutex_t *mutex)
Lock the mutex, logging any error.
Provide a convenient RAII-style mechanism to access mutex-protected resources.
Dynamic string implementation.