This makes the message issued refer to the file and line that called ovs_mutex_lock(), instead of to the file and line *inside* ovs_mutex_lock().
Signed-off-by: Ben Pfaff <b...@nicira.com> --- lib/ovs-thread.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c index fbdd7fc..83dfd62 100644 --- a/lib/ovs-thread.c +++ b/lib/ovs-thread.c @@ -55,7 +55,10 @@ static bool multithreaded; int error; \ \ /* Verify that 'l' was initialized. */ \ - ovs_assert(l->where); \ + if (OVS_UNLIKELY(!l->where)) { \ + ovs_abort(0, "%s: %s() passed uninitialized ovs_"#TYPE, \ + where, __func__); \ + } \ \ error = pthread_##TYPE##_##FUN(&l->lock); \ if (OVS_UNLIKELY(error)) { \ @@ -77,7 +80,10 @@ LOCK_FUNCTION(rwlock, wrlock); int error; \ \ /* Verify that 'l' was initialized. */ \ - ovs_assert(l->where); \ + if (OVS_UNLIKELY(!l->where)) { \ + ovs_abort(0, "%s: %s() passed uninitialized ovs_"#TYPE, \ + where, __func__); \ + } \ \ error = pthread_##TYPE##_##FUN(&l->lock); \ if (OVS_UNLIKELY(error) && error != EBUSY) { \ -- 1.7.10.4 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev