| 63 | } |
| 64 | |
| 65 | void CreateThread() |
| 66 | { |
| 67 | pthread_attr_t attr; |
| 68 | pthread_attr_init(&attr); |
| 69 | emscripten_pthread_attr_settransferredcanvases(&attr, "#canvas"); |
| 70 | int rc = pthread_create(&thread, &attr, ThreadMain, 0); |
| 71 | if (rc == ENOSYS) |
| 72 | { |
| 73 | printf("Test Skipped! OffscreenCanvas is not supported!\n"); |
| 74 | #ifdef REPORT_RESULT |
| 75 | REPORT_RESULT(1); // But report success, so that runs on non-supporting browsers don't raise noisy errors. |
| 76 | #endif |
| 77 | exit(0); |
| 78 | } |
| 79 | if (rc) |
| 80 | { |
| 81 | printf("Failed to create thread! error: %d\n", rc); |
| 82 | exit(0); |
| 83 | } |
| 84 | pthread_attr_destroy(&attr); |
| 85 | ++numThreadsCreated; |
| 86 | } |
| 87 | |
| 88 | void *mymain(void* arg) |
| 89 | { |
no test coverage detected