Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
a8527429
Commit
a8527429
authored
Nov 13, 2012
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unload dll / destroy hash ctxs at shutdown
parent
7ebefd22
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
0 deletions
+37
-0
src/global.c
+6
-0
src/global.h
+2
-0
src/hash.h
+1
-0
src/hash/hash_generic.h
+1
-0
src/hash/hash_openssl.h
+1
-0
src/hash/hash_ppc.h
+1
-0
src/hash/hash_win32.c
+25
-0
No files found.
src/global.c
View file @
a8527429
...
@@ -79,6 +79,9 @@ void git_threads_shutdown(void)
...
@@ -79,6 +79,9 @@ void git_threads_shutdown(void)
TlsFree
(
_tls_index
);
TlsFree
(
_tls_index
);
_tls_init
=
0
;
_tls_init
=
0
;
git_mutex_free
(
&
git__mwindow_mutex
);
git_mutex_free
(
&
git__mwindow_mutex
);
/* Shut down any subsystems that have global state */
git_hash_global_shutdown
();
}
}
git_global_st
*
git__global_state
(
void
)
git_global_st
*
git__global_state
(
void
)
...
@@ -131,6 +134,9 @@ void git_threads_shutdown(void)
...
@@ -131,6 +134,9 @@ void git_threads_shutdown(void)
{
{
pthread_key_delete
(
_tls_key
);
pthread_key_delete
(
_tls_key
);
_tls_init
=
0
;
_tls_init
=
0
;
/* Shut down any subsystems that have global state */
git_hash_global_shutdown
();
}
}
git_global_st
*
git__global_state
(
void
)
git_global_st
*
git__global_state
(
void
)
...
...
src/global.h
View file @
a8527429
...
@@ -14,6 +14,8 @@
...
@@ -14,6 +14,8 @@
# define GIT_MEMORY_BARRIER MemoryBarrier()
# define GIT_MEMORY_BARRIER MemoryBarrier()
#elif defined(GIT_THREADS)
#elif defined(GIT_THREADS)
# define GIT_MEMORY_BARRIER __sync_synchronize()
# define GIT_MEMORY_BARRIER __sync_synchronize()
#else
# define GIT_MEMORY_BARRIER
/* noop */
#endif
#endif
typedef
struct
{
typedef
struct
{
...
...
src/hash.h
View file @
a8527429
...
@@ -13,6 +13,7 @@ typedef struct git_hash_prov git_hash_prov;
...
@@ -13,6 +13,7 @@ typedef struct git_hash_prov git_hash_prov;
typedef
struct
git_hash_ctx
git_hash_ctx
;
typedef
struct
git_hash_ctx
git_hash_ctx
;
int
git_hash_global_init
(
void
);
int
git_hash_global_init
(
void
);
void
git_hash_global_shutdown
(
void
);
int
git_hash_ctx_init
(
git_hash_ctx
*
ctx
);
int
git_hash_ctx_init
(
git_hash_ctx
*
ctx
);
void
git_hash_ctx_cleanup
(
git_hash_ctx
*
ctx
);
void
git_hash_ctx_cleanup
(
git_hash_ctx
*
ctx
);
...
...
src/hash/hash_generic.h
View file @
a8527429
...
@@ -17,6 +17,7 @@ struct git_hash_ctx {
...
@@ -17,6 +17,7 @@ struct git_hash_ctx {
};
};
#define git_hash_global_init() 0
#define git_hash_global_init() 0
#define git_hash_global_shutdown()
/* noop */
#define git_hash_ctx_init(ctx) git_hash_init(ctx)
#define git_hash_ctx_init(ctx) git_hash_init(ctx)
#define git_hash_ctx_cleanup(ctx)
#define git_hash_ctx_cleanup(ctx)
...
...
src/hash/hash_openssl.h
View file @
a8527429
...
@@ -17,6 +17,7 @@ struct git_hash_ctx {
...
@@ -17,6 +17,7 @@ struct git_hash_ctx {
};
};
#define git_hash_global_init() 0
#define git_hash_global_init() 0
#define git_hash_global_shutdown()
/* noop */
#define git_hash_ctx_init(ctx) git_hash_init(ctx)
#define git_hash_ctx_init(ctx) git_hash_init(ctx)
#define git_hash_ctx_cleanup(ctx)
#define git_hash_ctx_cleanup(ctx)
...
...
src/hash/hash_ppc.h
View file @
a8527429
...
@@ -21,6 +21,7 @@ struct git_hash_ctx {
...
@@ -21,6 +21,7 @@ struct git_hash_ctx {
};
};
#define git_hash_global_init() 0
#define git_hash_global_init() 0
#define git_hash_global_shutdown()
/* noop */
#define git_hash_ctx_init(ctx) git_hash_init(ctx)
#define git_hash_ctx_init(ctx) git_hash_init(ctx)
#define git_hash_ctx_cleanup(ctx)
#define git_hash_ctx_cleanup(ctx)
...
...
src/hash/hash_win32.c
View file @
a8527429
...
@@ -26,6 +26,8 @@ GIT_INLINE(int) hash_cng_prov_init(void)
...
@@ -26,6 +26,8 @@ GIT_INLINE(int) hash_cng_prov_init(void)
char
dll_path
[
MAX_PATH
];
char
dll_path
[
MAX_PATH
];
DWORD
dll_path_len
,
size_len
;
DWORD
dll_path_len
,
size_len
;
return
-
1
;
/* Only use CNG on Windows 2008 / Vista SP1 or better (Windows 6.0 SP1) */
/* Only use CNG on Windows 2008 / Vista SP1 or better (Windows 6.0 SP1) */
version_test
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFOEX
);
version_test
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFOEX
);
version_test
.
dwMajorVersion
=
6
;
version_test
.
dwMajorVersion
=
6
;
...
@@ -79,6 +81,14 @@ GIT_INLINE(int) hash_cng_prov_init(void)
...
@@ -79,6 +81,14 @@ GIT_INLINE(int) hash_cng_prov_init(void)
return
0
;
return
0
;
}
}
GIT_INLINE
(
void
)
hash_cng_prov_shutdown
(
void
)
{
hash_prov
.
prov
.
cng
.
close_algorithm_provider
(
hash_prov
.
prov
.
cng
.
handle
,
0
);
FreeLibrary
(
hash_prov
.
prov
.
cng
.
dll
);
hash_prov
.
type
=
INVALID
;
}
/* Initialize CryptoAPI */
/* Initialize CryptoAPI */
GIT_INLINE
(
int
)
hash_cryptoapi_prov_init
()
GIT_INLINE
(
int
)
hash_cryptoapi_prov_init
()
{
{
...
@@ -89,6 +99,13 @@ GIT_INLINE(int) hash_cryptoapi_prov_init()
...
@@ -89,6 +99,13 @@ GIT_INLINE(int) hash_cryptoapi_prov_init()
return
0
;
return
0
;
}
}
GIT_INLINE
(
void
)
hash_cryptoapi_prov_shutdown
(
void
)
{
CryptReleaseContext
(
hash_prov
.
prov
.
cryptoapi
.
handle
,
0
);
hash_prov
.
type
=
INVALID
;
}
int
git_hash_global_init
()
int
git_hash_global_init
()
{
{
int
error
=
0
;
int
error
=
0
;
...
@@ -102,6 +119,14 @@ int git_hash_global_init()
...
@@ -102,6 +119,14 @@ int git_hash_global_init()
return
error
;
return
error
;
}
}
void
git_hash_global_shutdown
()
{
if
(
hash_prov
.
type
==
CNG
)
hash_cng_prov_shutdown
();
else
if
(
hash_prov
.
type
==
CRYPTOAPI
)
hash_cryptoapi_prov_shutdown
();
}
/* CryptoAPI: available in Windows XP and newer */
/* CryptoAPI: available in Windows XP and newer */
GIT_INLINE
(
int
)
hash_ctx_cryptoapi_init
(
git_hash_ctx
*
ctx
)
GIT_INLINE
(
int
)
hash_ctx_cryptoapi_init
(
git_hash_ctx
*
ctx
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment