Changeset d923fca for tests/concurrency/pthread/pthread_attr_test.cfa
- Timestamp:
- Feb 18, 2025, 12:54:23 PM (6 weeks ago)
- Branches:
- master
- Children:
- 8705a11
- Parents:
- 3e5fea2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified tests/concurrency/pthread/pthread_attr_test.cfa ¶
r3e5fea2 rd923fca 4 4 #include <thread.hfa> 5 5 6 void* foo(void* _attr){ 6 void* foo(void*){ 7 pthread_t self = pthread_self(); 8 pthread_attr_t self_attr; 9 pthread_getattr_np(self, &self_attr); 10 7 11 size_t size; 8 pthread_attr_t* attr = (pthread_attr_t*)_attr; 9 int status = pthread_attr_getstacksize(attr, &size); 12 int status = pthread_attr_getstacksize(&self_attr, &size); 10 13 if (status != 0){ 11 14 sout | "error return code"; … … 16 19 } 17 20 18 int main( int argc, char const *argv[])21 int main() 19 22 { 20 23 pthread_attr_t attr; … … 23 26 pthread_t thr; 24 27 void* res; 25 pthread_create(&thr, &attr, foo, (void*) &attr);28 pthread_create(&thr, &attr, foo, (void*)0); 26 29 pthread_join(thr, &res); 27 30 pthread_attr_destroy(&attr);
Note: See TracChangeset
for help on using the changeset viewer.