From: Eric Bollengier Date: Sat, 24 Mar 2007 07:42:48 +0000 (+0000) Subject: ebl add a mutex in repport generation X-Git-Tag: Release-7.0.0~6720 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6a013180381777d63c8be76ea322dea45a2730b1;p=bacula%2Fbacula ebl add a mutex in repport generation git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4405 91ce42f0-d328-0410-95d8-f526ca767f89 --- 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; }