OLD | NEW |
1 #include "libxml.h" | 1 #include "libxml.h" |
2 | 2 |
3 #include <stdlib.h> | 3 #include <stdlib.h> |
4 #include <stdio.h> | 4 #include <stdio.h> |
5 | 5 |
6 #if defined(LIBXML_THREAD_ENABLED) && defined(LIBXML_CATALOG_ENABLED) && defined
(LIBXML_SAX1_ENABLED) | 6 #if defined(LIBXML_THREAD_ENABLED) && defined(LIBXML_CATALOG_ENABLED) && defined
(LIBXML_SAX1_ENABLED) |
7 #include <libxml/globals.h> | 7 #include <libxml/globals.h> |
8 #include <libxml/threads.h> | 8 #include <libxml/threads.h> |
9 #include <libxml/parser.h> | 9 #include <libxml/parser.h> |
10 #include <libxml/catalog.h> | 10 #include <libxml/catalog.h> |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 { | 98 { |
99 unsigned int i, repeat; | 99 unsigned int i, repeat; |
100 unsigned int num_threads = sizeof(testfiles) / sizeof(testfiles[0]); | 100 unsigned int num_threads = sizeof(testfiles) / sizeof(testfiles[0]); |
101 void *results[MAX_ARGC]; | 101 void *results[MAX_ARGC]; |
102 int ret; | 102 int ret; |
103 | 103 |
104 xmlInitParser(); | 104 xmlInitParser(); |
105 for (repeat = 0;repeat < 500;repeat++) { | 105 for (repeat = 0;repeat < 500;repeat++) { |
106 xmlLoadCatalog(catalog); | 106 xmlLoadCatalog(catalog); |
107 | 107 |
108 » for (i = 0; i < num_threads; i++) { | 108 memset(results, 0, sizeof(*results)*num_threads); |
109 » results[i] = NULL; | 109 memset(tid, 0xff, sizeof(*tid)*num_threads); |
110 » tid[i] = (pthread_t) -1; | |
111 » } | |
112 | 110 |
113 for (i = 0; i < num_threads; i++) { | 111 for (i = 0; i < num_threads; i++) { |
114 ret = pthread_create(&tid[i], NULL, thread_specific_data, | 112 ret = pthread_create(&tid[i], NULL, thread_specific_data, |
115 (void *) testfiles[i]); | 113 (void *) testfiles[i]); |
116 if (ret != 0) { | 114 if (ret != 0) { |
117 perror("pthread_create"); | 115 perror("pthread_create"); |
118 exit(1); | 116 exit(1); |
119 } | 117 } |
120 } | 118 } |
121 for (i = 0; i < num_threads; i++) { | 119 for (i = 0; i < num_threads; i++) { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 #endif /* pthreads or BeOS threads */ | 191 #endif /* pthreads or BeOS threads */ |
194 | 192 |
195 #else /* !LIBXML_THREADS_ENABLED */ | 193 #else /* !LIBXML_THREADS_ENABLED */ |
196 int | 194 int |
197 main(void) | 195 main(void) |
198 { | 196 { |
199 fprintf(stderr, "libxml was not compiled with thread or catalog support\n"); | 197 fprintf(stderr, "libxml was not compiled with thread or catalog support\n"); |
200 return (0); | 198 return (0); |
201 } | 199 } |
202 #endif | 200 #endif |
OLD | NEW |