Changeset b0f459734980ed8bc36fd968587c64f77c72aa4b
- Timestamp:
- 05/17/07 19:03:56
(1 year ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1179421436 +0000
- git-parent:
[04d05b50633957945de3cbbf955e67cfb5905a65]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1179421436 +0000
- Message:
Fix initialization
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r10ee356 |
rb0f4597 |
|
| 37 | 37 | srtp_LDADD = libvlc_srtp.la |
|---|
| 38 | 38 | |
|---|
| | 39 | lcov-run: |
|---|
| | 40 | rm -f *.gcda lcov |
|---|
| | 41 | $(MAKE) $(AM_MAKEFLAGS) check |
|---|
| | 42 | |
|---|
| | 43 | lcov-pre.out: |
|---|
| | 44 | lcov -c -d . -o lcov.tmp |
|---|
| | 45 | |
|---|
| | 46 | lcov.out: lcov-pre.out |
|---|
| | 47 | lcov -r lcov.tmp '*test*' > lcov.out |
|---|
| | 48 | |
|---|
| | 49 | lcov: lcov.out |
|---|
| | 50 | genhtml lcov.out -o lcov |
|---|
| | 51 | |
|---|
| | 52 | .PHONY: lcov-run |
|---|
| r7bdd4ba |
rb0f4597 |
|
| 91 | 91 | static void initonce_libgcrypt (void) |
|---|
| 92 | 92 | { |
|---|
| | 93 | #ifndef WIN32 |
|---|
| | 94 | gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); |
|---|
| | 95 | #endif |
|---|
| | 96 | |
|---|
| 93 | 97 | if ((gcry_check_version ("1.1.94") == NULL) |
|---|
| 94 | 98 | || gcry_control (GCRYCTL_DISABLE_SECMEM, 0) |
|---|
| 95 | | || gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0) |
|---|
| 96 | | #ifndef WIN32 |
|---|
| 97 | | || gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread) |
|---|
| 98 | | #endif |
|---|
| 99 | | ) |
|---|
| | 99 | || gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0)) |
|---|
| 100 | 100 | return; |
|---|
| 101 | 101 | |
|---|
| … | … | |
| 112 | 112 | pthread_mutex_lock (&mutex); |
|---|
| 113 | 113 | pthread_once (&once, initonce_libgcrypt); |
|---|
| 114 | | retval = -libgcrypt_usable; |
|---|
| 115 | | pthread_mutex_unlock (&mutex); |
|---|
| 116 | 114 | #else |
|---|
| 117 | 115 | # warning FIXME: This is not thread-safe. |
|---|
| 118 | 116 | if (!libgcrypt_usable) |
|---|
| 119 | 117 | initonce_libgcrypt (); |
|---|
| 120 | | retval = -libgcrypt_usable; |
|---|
| | 118 | #endif |
|---|
| | 119 | |
|---|
| | 120 | retval = libgcrypt_usable ? 0 : -1; |
|---|
| | 121 | |
|---|
| | 122 | #ifndef WIN32 |
|---|
| | 123 | pthread_mutex_unlock (&mutex); |
|---|
| 121 | 124 | #endif |
|---|
| 122 | 125 | |
|---|