From 59f8cf14204fa8940451add20abbb0eb26e1214d Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sat, 24 Oct 2009 11:48:20 +0200 Subject: [PATCH] force lock manger init --- bacula/src/lib/lockmgr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bacula/src/lib/lockmgr.c b/bacula/src/lib/lockmgr.c index d11017c43d..d035e24e8a 100644 --- a/bacula/src/lib/lockmgr.c +++ b/bacula/src/lib/lockmgr.c @@ -523,7 +523,7 @@ void *check_deadlock(void *) } /* This object is used when LMGR is not initialized */ -lmgr_dummy_thread_t dummy_lmgr; +static lmgr_dummy_thread_t dummy_lmgr; /* * Retrieve the lmgr_thread_t object from the stack @@ -721,11 +721,13 @@ int lmgr_thread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void*), void *arg) { + /* lmgr should be active (lmgr_init_thread() call in main()) */ + ASSERT(lmgr_is_active()); /* Will be freed by the child */ lmgr_thread_arg_t *a = (lmgr_thread_arg_t*) malloc(sizeof(lmgr_thread_arg_t)); a->start_routine = start_routine; a->arg = arg; - return pthread_create(thread, attr, lmgr_thread_launcher, a); + return pthread_create(thread, attr, lmgr_thread_launcher, a); } #else /* _USE_LOCKMGR */ -- 2.39.5