From 6a013180381777d63c8be76ea322dea45a2730b1 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sat, 24 Mar 2007 07:42:48 +0000 Subject: [PATCH] ebl add a mutex in repport generation git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4405 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/tools/bbatch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bacula/src/tools/bbatch.c b/bacula/src/tools/bbatch.c index 0e0ab6f909..b793dd3208 100644 --- a/bacula/src/tools/bbatch.c +++ b/bacula/src/tools/bbatch.c @@ -69,7 +69,7 @@ static const char *db_user = "bacula"; static const char *db_password = ""; static const char *db_host = NULL; -char *datafile=NULL; +static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static void usage() { @@ -275,12 +275,14 @@ static void *do_batch(void *jcr) db_write_batch_file_records(bjcr); btime_t end = get_current_btime(); + P(mutex); char ed1[200], ed2[200]; printf("\rbegin = %s, end = %s\n", edit_int64(begin, ed1),edit_int64(end, ed2)); printf("Insert time = %llims\n", (end - begin) / 10000); printf("Create %u files at %.2f/s\n", lineno, (lineno / ((float)((end - begin) / 1000000)))); nb--; + V(mutex); pthread_exit(NULL); return NULL; } -- 2.39.5