1 /* Code originally from Raimund Steger. */
7 #include <fontconfig/fontconfig.h>
17 static void test_match(int thr_num,int test_num)
25 pat = FcNameParse((const FcChar8 *)"New Century Schoolbook");
27 FcConfigSubstitute(0,pat,FcMatchPattern);
28 FcDefaultSubstitute(pat);
30 match = FcFontMatch(0,pat,&result);
32 FcPatternDestroy(pat);
33 FcPatternDestroy(match);
36 static void *run_test_in_thread(void *arg)
38 struct thr_arg_s *thr_arg=(struct thr_arg_s *)arg;
39 int thread_num = thr_arg->thr_num;
42 for(;i<NTEST;i++) test_match(thread_num,i);
44 printf("Thread %d: done\n",thread_num);
49 int main(int argc,char **argv)
51 pthread_t threads[NTHR];
54 printf("Creating %d threads\n",NTHR);
58 struct thr_arg_s thr_arg;
61 result = pthread_create(&threads[i],NULL,run_test_in_thread,
65 fprintf(stderr,"Cannot create thread %d\n",i);
72 pthread_join(threads[j],NULL);
73 printf("Joined thread %d\n",j);