#include <stdlib.h>
#include <assert.h>
#include <pthread.h>
+#include <string.h>
#include "apple_glx.h"
#include "apple_glx_context.h"
#include "apple_glx_drawable.h"
err = pthread_mutex_lock(&drawables_lock);
if (err) {
- fprintf(stderr, "pthread_mutex_lock failure in %s: %d\n",
- __func__, err);
+ fprintf(stderr, "pthread_mutex_lock failure in %s: %s\n",
+ __func__, strerror(err));
abort();
}
}
err = pthread_mutex_unlock(&drawables_lock);
if (err) {
- fprintf(stderr, "pthread_mutex_unlock failure in %s: %d\n",
- __func__, err);
+ fprintf(stderr, "pthread_mutex_unlock failure in %s: %s\n",
+ __func__, strerror(err));
abort();
}
}
err = pthread_mutex_lock(&agd->mutex);
if (err) {
- fprintf(stderr, "pthread_mutex_lock error: %d\n", err);
+ fprintf(stderr, "pthread_mutex_lock error: %s\n", strerror(err));
abort();
}
}
err = pthread_mutex_unlock(&d->mutex);
if (err) {
- fprintf(stderr, "pthread_mutex_unlock error: %d\n", err);
+ fprintf(stderr, "pthread_mutex_unlock error: %s\n", strerror(err));
abort();
}
}
err = pthread_mutexattr_init(&attr);
if (err) {
- fprintf(stderr, "pthread_mutexattr_init error: %d\n", err);
+ fprintf(stderr, "pthread_mutexattr_init error: %s\n", strerror(err));
abort();
}
err = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
if (err) {
- fprintf(stderr, "error: setting pthread mutex type: %d\n", err);
+ fprintf(stderr, "error: setting pthread mutex type: %s\n", strerror(err));
abort();
}
err = pthread_mutex_init(&d->mutex, &attr);
if (err) {
- fprintf(stderr, "pthread_mutex_init error: %d\n", err);
+ fprintf(stderr, "pthread_mutex_init error: %s\n", strerror(err));
abort();
}