Ignore:
Timestamp:
Aug 10, 2022, 8:33:42 PM (20 months ago)
Author:
z277zhu <z277zhu@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
7f6a7c9
Parents:
20be782
Message:

fix pthread_sig* interpose problems; add test doc

Signed-off-by: z277zhu <z277zhu@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrent/pthread/pthread_attr_test.cfa

    r20be782 r428adbc  
    44#include <thread.hfa>
    55
    6 void* foo(void* arg){
    7     sout | "Hi";
     6void* foo(void* _attr){
     7    size_t size;
     8    pthread_attr_t* attr = (pthread_attr_t*)_attr;
     9    int status = pthread_attr_getstacksize(attr, &size);
     10    if (status != 0){
     11        sout | "error return code";
     12        exit(1);
     13    }
     14    sout | "stack size is " | size;
    815    return NULL;
    916}
     
    1623    pthread_t thr;
    1724    void* res;
    18     pthread_create(&thr, &attr, foo, NULL);
     25    pthread_create(&thr, &attr, foo, (void*)&attr);
    1926    pthread_join(thr, &res);
    20     //pthread_attr_destroy(&attr);
     27    pthread_attr_destroy(&attr);
    2128    return 0;
    2229}
Note: See TracChangeset for help on using the changeset viewer.