| 78 | } |
| 79 | |
| 80 | static void test1() |
| 81 | { |
| 82 | CPLJoinableThread *hThread; |
| 83 | |
| 84 | printf("Start test1\n"); |
| 85 | printf("main thread %p\n", (void *)CPLGetPID()); |
| 86 | |
| 87 | GDALSetCacheMax(0); |
| 88 | |
| 89 | MyDataset *poDS = new MyDataset(); |
| 90 | |
| 91 | char buf1[] = {1}; |
| 92 | CPL_IGNORE_RET_VAL(GDALRasterIO(GDALGetRasterBand(poDS, 1), GF_Write, 0, 0, |
| 93 | 1, 1, buf1, 1, 1, GDT_Byte, 0, 0)); |
| 94 | |
| 95 | hThread = CPLCreateJoinableThread(thread_func1, nullptr); |
| 96 | CPLSleep(0.3); |
| 97 | CPL_IGNORE_RET_VAL(GDALRasterIO(GDALGetRasterBand(poDS, 1), GF_Write, 1, 0, |
| 98 | 1, 1, buf1, 1, 1, GDT_Byte, 0, 0)); |
| 99 | GDALFlushCacheBlock(); |
| 100 | |
| 101 | CPLJoinThread(hThread); |
| 102 | |
| 103 | delete poDS; |
| 104 | printf("End test1\n"); |
| 105 | } |
| 106 | |
| 107 | static void thread_func2(void * /* unused */) |
| 108 | { |
no test coverage detected