source: tests/concurrent/pthread/pthread_attr_test.cfa @ 20be782

ADTast-experimentalpthread-emulation
Last change on this file since 20be782 was 20be782, checked in by z277zhu <z277zhu@…>, 21 months ago

add pthread

  • Property mode set to 100644
File size: 452 bytes
Line 
1/* test attr init; set stack; get stack */
2
3#include <fstream.hfa>
4#include <thread.hfa>
5
6void* foo(void* arg){
7    sout | "Hi";
8    return NULL;
9}
10
11int main(int argc, char const *argv[])
12{
13    pthread_attr_t attr;
14    pthread_attr_init(&attr);
15    pthread_attr_setstacksize(&attr, 123456789);
16    pthread_t thr;
17    void* res;
18    pthread_create(&thr, &attr, foo, NULL);
19    pthread_join(thr, &res);
20    //pthread_attr_destroy(&attr);
21    return 0;
22}
Note: See TracBrowser for help on using the repository browser.