File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 2222#include <stdio.h>
2323#include <math.h>
2424#include <time.h>
25+
26+ #define USE_PTHREADS // Please change this to #undef USE_PTHREADS if your platform does not support pthread.h!
27+ // #undef USE_PTHREADS
28+
29+ #ifdef USE_PTHREADS
2530#include <pthread.h>
31+ #else
32+ #define pthread_mutex_lock (ignore ) // Fake implementation of pthread.
33+ #define pthread_mutex_unlock (ignore )
34+ #define pthread_mutex_t int
35+ #define PTHREAD_MUTEX_INITIALIZER 0
36+ #define pthread_t int
37+ #define pthread_join (ignore1 , ignore2 ) 0
38+ #define pthread_create (ignore1 , ignore2 , func , context ) func(context)
39+ #endif
2640
2741#include "../mapcodelib/mapcoder.c"
2842#include "../mapcodelib/mapcode_countrynames_short.h"
2943#include "test_territories.c"
3044#include "decode_test.h"
3145
3246#define MAXLINESIZE 1024
47+ #ifdef USE_PTHREADS
3348#define MAX_THREADS 16 // Optimal: not too much, approx. nr of cores * 2, better no more than 32.
34-
49+ #else
50+ #define MAX_THREADS 1
51+ #endif
3552
3653pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER ;
3754int nrErrors = 0 ;
@@ -563,6 +580,7 @@ void *execute_test_around(void *context) {
563580 return 0 ;
564581}
565582
583+
566584// test around all centers and corners of all territory rectangles
567585int re_encode_tests () {
568586 int nrTests = 0 ;
You can’t perform that action at this time.
0 commit comments