RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 04-Sep-2013 23:14:46 Branch: rpm-5_4 Handle: 2013090421144500 Modified files: (Branch: rpm-5_4) rpm/rpmio rpmgit.c tgit.c Log: - git: wire up git_threads. Summary: Revision Changes Path 2.1.2.36 +17 -0 rpm/rpmio/rpmgit.c 1.1.2.32 +0 -4 rpm/rpmio/tgit.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/rpmio/rpmgit.c ============================================================================ $ cvs diff -u -r2.1.2.35 -r2.1.2.36 rpmgit.c --- rpm/rpmio/rpmgit.c 4 Sep 2013 20:54:52 -0000 2.1.2.35 +++ rpm/rpmio/rpmgit.c 4 Sep 2013 21:14:45 -0000 2.1.2.36 @@ -24,6 +24,9 @@ /*@unchecked@*/ const char * _rpmgit_tree; /* XXX GIT_WORK_TREE */ +/*@unchecked@*/ +static int _rpmgit_threads; /* XXX git_threads_{init,shutdown} counter */ + #define SPEW(_t, _rc, _git) \ { if ((_t) || _rpmgit_debug ) \ fprintf(stderr, "<-- %s(%p) rc %d\n", __FUNCTION__, (_git), \ @@ -2382,6 +2385,12 @@ git_index_free(git->I); if (git->R) git_repository_free(git->R); + + /* XXX elsewhere: assumes rpmgitNew()/rpmgitFree() calls pair */ + if (--_rpmgit_threads <= 0) { + git_threads_shutdown(); + _rpmgit_threads = 0; + } #endif git->walk = NULL; git->odb = NULL; @@ -2416,6 +2425,7 @@ git->flags = 0; git->fn = _free(git->fn); + } /*@unchecked@*/ /*@only@*/ /*@null@*/ @@ -2480,6 +2490,13 @@ git->flags = flags; #if defined(WITH_LIBGIT2) + + /* XXX elsewhere: assumes rpmgitNew() calls pair */ + if (_rpmgit_threads <= 0) { + git_threads_init(); + _rpmgit_threads = 1; + } + if (initialize) { git_libgit2_version(&git->major, &git->minor, &git->rev); if (git->fn && git->R == NULL) { @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/tgit.c ============================================================================ $ cvs diff -u -r1.1.2.31 -r1.1.2.32 tgit.c --- rpm/rpmio/tgit.c 4 Sep 2013 18:33:50 -0000 1.1.2.31 +++ rpm/rpmio/tgit.c 4 Sep 2013 21:14:45 -0000 1.1.2.32 @@ -1808,8 +1808,6 @@ POPT_TABLEEND }; -git_threads_init(); - rpmgit git = rpmgitNew(argv, 0, cfOpts); FILE * fp = stdout; rpmRC rc = RPMRC_FAIL; @@ -1924,8 +1922,6 @@ git = rpmgitFree(git); -git_threads_shutdown(); - return rc; } #undef CF_ISSET @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org