Created
August 11, 2016 14:36
-
-
Save stelleg/f49347bd0cc5f1cc1bec43583ba8e92b to your computer and use it in GitHub Desktop.
qthreads test case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <qthread.h> | |
#include <qthread/sinc.h> | |
volatile int j = 0; | |
aligned_t task(void* arg){ | |
j ++; | |
} | |
int main(){ | |
qthread_initialize(); | |
qt_sinc_t *sinc = qt_sinc_create(0, NULL, NULL, 0); | |
for(int i=0; i<10; i++){ | |
qt_sinc_expect(sinc, 1); | |
qthread_spawn(task, | |
NULL, | |
0, | |
sinc, | |
0, | |
NULL, | |
NO_SHEPHERD, | |
QTHREAD_SPAWN_RET_SINC_VOID); | |
} | |
qt_sinc_expect(sinc, 10); | |
qt_sinc_wait(sinc, NULL); | |
return j; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment