aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/k5-thread.h
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2018-04-03 19:36:00 +0000
committerCy Schubert <cy@FreeBSD.org>2018-04-03 19:36:00 +0000
commitb0e4d68d5124581ae353493d69bea352de4cff8a (patch)
tree43300ec43e83eccd367fd76fdfdefba2dcd7d8f4 /src/include/k5-thread.h
parent33a9b234e7087f573ef08cd7318c6497ba08b439 (diff)
downloadsrc-vendor/krb5.tar.gz
src-vendor/krb5.zip
Import MIT KRB5 1.16.vendor/krb5/1.16vendor/krb5
Notes
Notes: svn path=/vendor-crypto/krb5/dist/; revision=331939 svn path=/vendor-crypto/krb5/1.16/; revision=331941; tag=vendor/krb5/1.16
Diffstat (limited to 'src/include/k5-thread.h')
-rw-r--r--src/include/k5-thread.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/include/k5-thread.h b/src/include/k5-thread.h
index 3e3901d6e8fb..a3101239d8a5 100644
--- a/src/include/k5-thread.h
+++ b/src/include/k5-thread.h
@@ -134,6 +134,10 @@
More to be added, perhaps. */
#include <assert.h>
+#ifndef NDEBUG
+#include <stdio.h>
+#include <string.h>
+#endif
/* The mutex structure we use, k5_mutex_t, is defined to some
OS-specific bits. The use of multiple layers of typedefs are an
@@ -363,12 +367,24 @@ static inline int k5_mutex_finish_init(k5_mutex_t *m)
static inline void k5_mutex_lock(k5_mutex_t *m)
{
int r = k5_os_mutex_lock(m);
+#ifndef NDEBUG
+ if (r != 0) {
+ fprintf(stderr, "k5_mutex_lock: Received error %d (%s)\n",
+ r, strerror(r));
+ }
+#endif
assert(r == 0);
}
static inline void k5_mutex_unlock(k5_mutex_t *m)
{
int r = k5_os_mutex_unlock(m);
+#ifndef NDEBUG
+ if (r != 0) {
+ fprintf(stderr, "k5_mutex_unlock: Received error %d (%s)\n",
+ r, strerror(r));
+ }
+#endif
assert(r == 0);
}