diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2015-07-09 21:25:56 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2015-07-09 21:25:56 +0200 |
| commit | 9f10ff75e863d121294c199ab4df77abaa6328d5 (patch) | |
| tree | d34339916ab7ecb2bfe199f5dc3728e162e89d94 /src/test228.c | |
| parent | 9f05b2dd07712d35fe3fa78934631b6a0142891f (diff) | |
| download | PROJ-9f10ff75e863d121294c199ab4df77abaa6328d5.tar.gz PROJ-9f10ff75e863d121294c199ab4df77abaa6328d5.zip | |
Improve multistresstest.c (and run it with Travis) and test228.c
Diffstat (limited to 'src/test228.c')
| -rw-r--r-- | src/test228.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/test228.c b/src/test228.c index 464c5736..cdfc8650 100644 --- a/src/test228.c +++ b/src/test228.c @@ -15,14 +15,18 @@ int main(int argc, char* argv[]) #include <assert.h> #include <unistd.h> -volatile int go_on = 1; +volatile int run = 0; +volatile int started = 0; void* thread_main(void* unused) { projCtx p_proj_ctxt; projPJ p_WGS84_proj; projPJ p_OSGB36_proj; - + + __sync_add_and_fetch(&started, 1); + while(run == 0); + p_proj_ctxt=pj_ctx_alloc(); p_WGS84_proj=pj_init_plus_ctx(p_proj_ctxt,"+proj=longlat " "+ellps=WGS84 +datum=WGS84 +no_defs"); @@ -30,7 +34,7 @@ void* thread_main(void* unused) "+proj=longlat +ellps=airy +datum=OSGB36 +nadgrids=OSTN02_NTv2.gsb " "+no_defs"); - while(go_on) + while(run) { double x, y; int proj_ret; @@ -61,9 +65,11 @@ int main(int argc, char* argv[]) pthread_create(&tid1, &attr1, thread_main, NULL); pthread_create(&tid2, &attr2, thread_main, NULL); + while(started != 2); + run = 1; for(i=0;i<2;i++) sleep(1); - go_on = 0; + run = 0; return 0; } |
