| Paste number 12030: | test |
| Pasted by: | pinskia |
| When: | 4 years, 10 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+9A6 |
| Channel: | None |
| Paste contents: |
pthread_key_t a;
struct A
{
A(){pthread_key_create(&a, NULL);}
~A(){pthread_key_delete(a);}
int t(){return 0;}
};
A aa;
int main(){return aa.t();}Annotations for this paste:
| Annotation number 1: | new testcase |
| Pasted by: | pinskia |
| When: | 4 years, 10 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+9A6/1 |
| Paste contents: |
#include <pthread.h>
pthread_key_t a;
struct A
{
A(){pthread_key_create(&a, NULL);}
~A(){pthread_key_delete(a);}
int t(){return 0;}
};
A aa;
void* threadfunc(void* x)
{
pthread_setspecific (a, (void*)1);
return NULL;
}
int main()
{
pthread_t thr;
pthread_create(&thr, NULL, &threadfunc, NULL);
pthread_join(thr, NULL);
pthread_setspecific (a, (void*)1);
return aa.t();
}