- File:
-
- 1 edited
-
libcfa/src/concurrency/pthread.cfa (modified) (37 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/pthread.cfa
rff443e5 r8bd886e 15 15 16 16 #define __cforall_thread__ 17 #define _GNU_SOURCE 17 18 18 19 #include <signal.h> … … 34 35 struct pthread_values{ 35 36 inline Seqable; 36 void * value;37 void* value; 37 38 bool in_use; 38 39 }; … … 50 51 struct pthread_keys { 51 52 bool in_use; 52 void (* destructor)( void * );53 void (*destructor)( void * ); 53 54 Sequence(pthread_values) threads; 54 55 }; 55 56 56 static void ?{}(pthread_keys& k) {57 static void ?{}(pthread_keys& k){ 57 58 k.threads{}; 58 59 } … … 61 62 static pthread_keys cfa_pthread_keys_storage[PTHREAD_KEYS_MAX] __attribute__((aligned (16))); 62 63 63 static void init_pthread_storage() {64 for ( int i = 0; i < PTHREAD_KEYS_MAX; i++ ){64 static void init_pthread_storage(){ 65 for (int i = 0; i < PTHREAD_KEYS_MAX; i++){ 65 66 cfa_pthread_keys_storage[i]{}; 66 67 } … … 95 96 96 97 /* condvar helper routines */ 97 static void init(pthread_cond_t * pcond){98 static void init(pthread_cond_t* pcond){ 98 99 static_assert(sizeof(pthread_cond_t) >= sizeof(cfa2pthr_cond_var_t),"sizeof(pthread_t) < sizeof(cfa2pthr_cond_var_t)"); 99 cfa2pthr_cond_var_t * _cond = (cfa2pthr_cond_var_t*)pcond;100 cfa2pthr_cond_var_t* _cond = (cfa2pthr_cond_var_t*)pcond; 100 101 ?{}(*_cond); 101 102 } 102 103 103 static cfa2pthr_cond_var_t * get(pthread_cond_t * pcond){104 static cfa2pthr_cond_var_t* get(pthread_cond_t* pcond){ 104 105 static_assert(sizeof(pthread_cond_t) >= sizeof(cfa2pthr_cond_var_t),"sizeof(pthread_t) < sizeof(cfa2pthr_cond_var_t)"); 105 return (cfa2pthr_cond_var_t *)pcond;106 } 107 108 static void destroy(pthread_cond_t * cond){106 return (cfa2pthr_cond_var_t*)pcond; 107 } 108 109 static void destroy(pthread_cond_t* cond){ 109 110 static_assert(sizeof(pthread_cond_t) >= sizeof(cfa2pthr_cond_var_t),"sizeof(pthread_t) < sizeof(cfa2pthr_cond_var_t)"); 110 111 ^?{}(*get(cond)); … … 115 116 116 117 /* mutex helper routines */ 117 static void mutex_check(pthread_mutex_t * t){118 static void mutex_check(pthread_mutex_t* t){ 118 119 // Use double check to improve performance. 119 120 // Check is safe on x86; volatile prevents compiler reordering 120 volatile pthread_mutex_t * const mutex_ = t;121 volatile pthread_mutex_t *const mutex_ = t; 121 122 122 123 // SKULLDUGGERY: not a portable way to access the kind field, /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h … … 135 136 136 137 137 static void init(pthread_mutex_t * plock){138 static void init(pthread_mutex_t* plock){ 138 139 static_assert(sizeof(pthread_mutex_t) >= sizeof(simple_owner_lock),"sizeof(pthread_mutex_t) < sizeof(simple_owner_lock)"); 139 simple_owner_lock * _lock = (simple_owner_lock*)plock;140 simple_owner_lock* _lock = (simple_owner_lock*)plock; 140 141 ?{}(*_lock); 141 142 } 142 143 143 static simple_owner_lock * get(pthread_mutex_t * plock){144 static simple_owner_lock* get(pthread_mutex_t* plock){ 144 145 static_assert(sizeof(pthread_mutex_t) >= sizeof(simple_owner_lock),"sizeof(pthread_mutex_t) < sizeof(simple_owner_lock)"); 145 return (simple_owner_lock *)plock;146 } 147 148 static void destroy(pthread_mutex_t * plock){146 return (simple_owner_lock*)plock; 147 } 148 149 static void destroy(pthread_mutex_t* plock){ 149 150 static_assert(sizeof(pthread_mutex_t) >= sizeof(simple_owner_lock),"sizeof(pthread_mutex_t) < sizeof(simple_owner_lock)"); 150 151 ^?{}(*get(plock)); … … 152 153 153 154 //######################### Attr helpers ######################### 154 typedef struct cfaPthread_attr_t {// thread attributes155 struct cfaPthread_attr_t { // thread attributes 155 156 int contentionscope; 156 157 int detachstate; 157 158 size_t stacksize; 158 void * stackaddr;159 void *stackaddr; 159 160 int policy; 160 161 int inheritsched; 161 162 struct sched_param param; 162 } cfaPthread_attr_t;163 164 static const cfaPthread_attr_t default_attrs {163 } typedef cfaPthread_attr_t; 164 165 static const cfaPthread_attr_t default_attrs{ 165 166 0, 166 167 0, 167 65_000,168 NULL,168 (size_t)65000, 169 (void *)NULL, 169 170 0, 170 171 0, … … 172 173 }; 173 174 174 static cfaPthread_attr_t * get(const pthread_attr_t * attr){175 static_assert(sizeof(pthread_attr_t) >= sizeof(cfaPthread_attr_t), "sizeof(pthread_attr_t) < sizeof(cfaPthread_attr_t)");176 return (cfaPthread_attr_t *)attr;175 static cfaPthread_attr_t* get(const pthread_attr_t* attr){ 176 static_assert(sizeof(pthread_attr_t) >= sizeof(cfaPthread_attr_t),"sizeof(pthread_attr_t) < sizeof(cfaPthread_attr_t)"); 177 return (cfaPthread_attr_t*)attr; 177 178 } 178 179 … … 189 190 190 191 // pthreads return value 191 void * joinval;192 void *joinval; 192 193 193 194 // pthread attributes 194 195 pthread_attr_t pthread_attr; 195 196 196 void *(* start_routine)(void *);197 void * start_arg;197 void *(*start_routine)(void *); 198 void *start_arg; 198 199 199 200 // thread local data 200 pthread_values * pthreadData;201 pthread_values* pthreadData; 201 202 202 203 // flag used for tryjoin … … 206 207 /* thread part routines */ 207 208 // cfaPthread entry point 208 void main(cfaPthread & _thread) with(_thread){209 joinval = start_routine(start_arg);209 void main(cfaPthread& _thread) with(_thread){ 210 joinval = start_routine(start_arg); 210 211 isTerminated = true; 211 212 } 212 213 213 static cfaPthread * lookup( pthread_t p ){214 static_assert(sizeof(pthread_t) >= sizeof(cfaPthread *),"sizeof(pthread_t) < sizeof(cfaPthread*)");215 return (cfaPthread *)p;216 } 217 218 static void pthread_deletespecific_( pthread_values * values ) { // see uMachContext::invokeTask219 pthread_values * value;220 pthread_keys * key;214 static cfaPthread *lookup( pthread_t p ){ 215 static_assert(sizeof(pthread_t) >= sizeof(cfaPthread*),"sizeof(pthread_t) < sizeof(cfaPthread*)"); 216 return (cfaPthread*)p; 217 } 218 219 static void pthread_deletespecific_( pthread_values* values ) { // see uMachContext::invokeTask 220 pthread_values* value; 221 pthread_keys* key; 221 222 bool destcalled = true; 222 if (values != NULL) {223 if (values != NULL){ 223 224 for ( int attempts = 0; attempts < PTHREAD_DESTRUCTOR_ITERATIONS && destcalled ; attempts += 1 ) { 224 225 destcalled = false; 225 226 lock(key_lock); 226 for ( int i = 0; i < PTHREAD_KEYS_MAX; i++ ){227 for (int i = 0; i < PTHREAD_KEYS_MAX; i++){ 227 228 // for each valid key 228 if ( values[i].in_use) {229 if ( values[i].in_use){ 229 230 value = &values[i]; 230 231 key = &cfa_pthread_keys[i]; … … 233 234 // if a key value has a non-NULL destructor pointer, and the thread has a non-NULL value associated with that key, 234 235 // the value of the key is set to NULL, and then the function pointed to is called with the previously associated value as its sole argument. 235 if (value->value != NULL && key->destructor != NULL) {236 if (value->value != NULL && key->destructor != NULL){ 236 237 unlock(key_lock); 237 238 key->destructor(value->value); // run destructor … … 248 249 } 249 250 250 static void ^?{}(cfaPthread & mutex t) {251 static void ^?{}(cfaPthread & mutex t){ 251 252 // delete pthread local storage 252 253 pthread_values * values = t.pthreadData; … … 254 255 } 255 256 256 static void ?{}(cfaPthread & t, pthread_t * _thread, const pthread_attr_t * _attr,void *(*start_routine)(void *), void * arg) {257 static_assert(sizeof(pthread_t) >= sizeof(cfaPthread *), "pthread_t too small to hold a pointer: sizeof(pthread_t) < sizeof(cfaPthread*)");257 static void ?{}(cfaPthread &t, pthread_t* _thread, const pthread_attr_t * _attr,void *(*start_routine)(void *), void * arg) { 258 static_assert(sizeof(pthread_t) >= sizeof(cfaPthread*), "pthread_t too small to hold a pointer: sizeof(pthread_t) < sizeof(cfaPthread*)"); 258 259 259 260 // set up user thread stackSize … … 277 278 //######################### Pthread Attrs ######################### 278 279 279 int pthread_attr_init(pthread_attr_t * attr) libcfa_public __THROW {280 cfaPthread_attr_t * _attr = get(attr);280 int pthread_attr_init(pthread_attr_t *attr) libcfa_public __THROW { 281 cfaPthread_attr_t* _attr = get(attr); 281 282 ?{}(*_attr, default_attrs); 282 283 return 0; 283 284 } 284 int pthread_attr_destroy(pthread_attr_t * attr) libcfa_public __THROW {285 int pthread_attr_destroy(pthread_attr_t *attr) libcfa_public __THROW { 285 286 ^?{}(*get(attr)); 286 287 return 0; 287 288 } 288 289 289 int pthread_attr_setscope( pthread_attr_t * attr, int contentionscope ) libcfa_public __THROW {290 int pthread_attr_setscope( pthread_attr_t *attr, int contentionscope ) libcfa_public __THROW { 290 291 get( attr )->contentionscope = contentionscope; 291 292 return 0; 292 293 } // pthread_attr_setscope 293 294 294 int pthread_attr_getscope( const pthread_attr_t * attr, int *contentionscope ) libcfa_public __THROW {295 int pthread_attr_getscope( const pthread_attr_t *attr, int *contentionscope ) libcfa_public __THROW { 295 296 *contentionscope = get( attr )->contentionscope; 296 297 return 0; 297 298 } // pthread_attr_getscope 298 299 299 int pthread_attr_setdetachstate( pthread_attr_t * attr, int detachstate ) libcfa_public __THROW {300 int pthread_attr_setdetachstate( pthread_attr_t *attr, int detachstate ) libcfa_public __THROW { 300 301 get( attr )->detachstate = detachstate; 301 302 return 0; 302 303 } // pthread_attr_setdetachstate 303 304 304 int pthread_attr_getdetachstate( const pthread_attr_t * attr, int *detachstate ) libcfa_public __THROW {305 int pthread_attr_getdetachstate( const pthread_attr_t *attr, int *detachstate ) libcfa_public __THROW { 305 306 *detachstate = get( attr )->detachstate; 306 307 return 0; 307 308 } // pthread_attr_getdetachstate 308 309 309 int pthread_attr_setstacksize( pthread_attr_t * attr, size_t stacksize ) libcfa_public __THROW {310 int pthread_attr_setstacksize( pthread_attr_t *attr, size_t stacksize ) libcfa_public __THROW { 310 311 get( attr )->stacksize = stacksize; 311 312 return 0; 312 313 } // pthread_attr_setstacksize 313 314 314 int pthread_attr_getstacksize( const pthread_attr_t * attr, size_t *stacksize ) libcfa_public __THROW {315 int pthread_attr_getstacksize( const pthread_attr_t *attr, size_t *stacksize ) libcfa_public __THROW { 315 316 *stacksize = get( attr )->stacksize; 316 317 return 0; … … 325 326 } // pthread_attr_setguardsize 326 327 327 int pthread_attr_setstackaddr( pthread_attr_t * attr, void *stackaddr ) libcfa_public __THROW {328 int pthread_attr_setstackaddr( pthread_attr_t *attr, void *stackaddr ) libcfa_public __THROW { 328 329 get( attr )->stackaddr = stackaddr; 329 330 return 0; 330 331 } // pthread_attr_setstackaddr 331 332 332 int pthread_attr_getstackaddr( const pthread_attr_t * attr, void **stackaddr ) libcfa_public __THROW {333 int pthread_attr_getstackaddr( const pthread_attr_t *attr, void **stackaddr ) libcfa_public __THROW { 333 334 *stackaddr = get( attr )->stackaddr; 334 335 return 0; 335 336 } // pthread_attr_getstackaddr 336 337 337 int pthread_attr_setstack( pthread_attr_t * attr, void *stackaddr, size_t stacksize ) libcfa_public __THROW {338 int pthread_attr_setstack( pthread_attr_t *attr, void *stackaddr, size_t stacksize ) libcfa_public __THROW { 338 339 get( attr )->stackaddr = stackaddr; 339 340 get( attr )->stacksize = stacksize; … … 341 342 } // pthread_attr_setstack 342 343 343 int pthread_attr_getstack( const pthread_attr_t * attr, void ** stackaddr, size_t *stacksize ) libcfa_public __THROW {344 int pthread_attr_getstack( const pthread_attr_t *attr, void **stackaddr, size_t *stacksize ) libcfa_public __THROW { 344 345 *stackaddr = get( attr )->stackaddr; 345 346 *stacksize = get( attr )->stacksize; … … 350 351 // already running thread threadID. It shall be called on unitialized attr 351 352 // and destroyed with pthread_attr_destroy when no longer needed. 352 int pthread_getattr_np( pthread_t threadID, pthread_attr_t * attr ) libcfa_public __THROW { // GNU extension353 int pthread_getattr_np( pthread_t threadID, pthread_attr_t *attr ) libcfa_public __THROW { // GNU extension 353 354 check_nonnull(attr); 354 355 … … 362 363 //######################### Threads ######################### 363 364 364 int pthread_create(pthread_t * _thread, const pthread_attr_t * attr, void *(* start_routine)(void *), void * arg) libcfa_public __THROW {365 cfaPthread * t = alloc();365 int pthread_create(pthread_t * _thread, const pthread_attr_t * attr, void *(*start_routine)(void *), void * arg) libcfa_public __THROW { 366 cfaPthread *t = alloc(); 366 367 (*t){_thread, attr, start_routine, arg}; 367 368 return 0; 368 369 } 369 370 370 int pthread_join(pthread_t _thread, void ** value_ptr) libcfa_public __THROW { 371 372 int pthread_join(pthread_t _thread, void **value_ptr) libcfa_public __THROW { 371 373 // if thread is invalid 372 374 if (_thread == NULL) return EINVAL; … … 374 376 375 377 // get user thr pointer 376 cfaPthread * p = lookup(_thread);378 cfaPthread* p = lookup(_thread); 377 379 try { 378 380 join(*p); … … 387 389 } 388 390 389 int pthread_tryjoin_np(pthread_t _thread, void ** value_ptr) libcfa_public __THROW {391 int pthread_tryjoin_np(pthread_t _thread, void **value_ptr) libcfa_public __THROW { 390 392 // if thread is invalid 391 393 if (_thread == NULL) return EINVAL; 392 394 if (_thread == pthread_self()) return EDEADLK; 393 395 394 cfaPthread * p = lookup(_thread);396 cfaPthread* p = lookup(_thread); 395 397 396 398 // thread not finished ? … … 410 412 void pthread_exit(void * status) libcfa_public __THROW { 411 413 pthread_t pid = pthread_self(); 412 cfaPthread * _thread = (cfaPthread*)pid;414 cfaPthread* _thread = (cfaPthread*)pid; 413 415 _thread->joinval = status; // set return value 414 416 _thread->isTerminated = 1; // set terminated flag … … 424 426 //######################### Mutex ######################### 425 427 426 int pthread_mutex_init(pthread_mutex_t *_mutex, const pthread_mutexattr_t * attr) libcfa_public __THROW {428 int pthread_mutex_init(pthread_mutex_t *_mutex, const pthread_mutexattr_t *attr) libcfa_public __THROW { 427 429 check_nonnull(_mutex); 428 430 init(_mutex); … … 433 435 int pthread_mutex_destroy(pthread_mutex_t *_mutex) libcfa_public __THROW { 434 436 check_nonnull(_mutex); 435 simple_owner_lock * _lock = get(_mutex);436 if (_lock->owner != NULL) {437 simple_owner_lock* _lock = get(_mutex); 438 if (_lock->owner != NULL){ 437 439 return EBUSY; 438 440 } … … 444 446 check_nonnull(_mutex); 445 447 mutex_check(_mutex); 446 simple_owner_lock * _lock = get(_mutex);448 simple_owner_lock* _lock = get(_mutex); 447 449 lock(*_lock); 448 450 return 0; … … 451 453 int pthread_mutex_unlock(pthread_mutex_t *_mutex) libcfa_public __THROW { 452 454 check_nonnull(_mutex); 453 simple_owner_lock * _lock = get(_mutex);454 if (_lock->owner != active_thread()) {455 simple_owner_lock* _lock = get(_mutex); 456 if (_lock->owner != active_thread()){ 455 457 return EPERM; 456 458 } // current thread does not hold the mutex … … 461 463 int pthread_mutex_trylock(pthread_mutex_t *_mutex) libcfa_public __THROW { 462 464 check_nonnull(_mutex); 463 simple_owner_lock * _lock = get(_mutex);464 if (_lock->owner != active_thread() && _lock->owner != NULL) {465 simple_owner_lock* _lock = get(_mutex); 466 if (_lock->owner != active_thread() && _lock->owner != NULL){ 465 467 return EBUSY; 466 468 } // if mutex is owned … … 472 474 473 475 /* conditional variable routines */ 474 int pthread_cond_init(pthread_cond_t * cond, const pthread_condattr_t *attr) libcfa_public __THROW {476 int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) libcfa_public __THROW { 475 477 check_nonnull(cond); 476 478 init(cond); … … 478 480 } //pthread_cond_init 479 481 480 int pthread_cond_wait(pthread_cond_t * cond, pthread_mutex_t *_mutex) libcfa_public __THROW {482 int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *_mutex) libcfa_public __THROW { 481 483 check_nonnull(_mutex); 482 484 check_nonnull(cond); … … 492 494 } // pthread_cond_timedwait 493 495 494 int pthread_cond_signal(pthread_cond_t * cond) libcfa_public __THROW {496 int pthread_cond_signal(pthread_cond_t *cond) libcfa_public __THROW { 495 497 check_nonnull(cond); 496 498 return notify_one(*get(cond)); 497 499 } // pthread_cond_signal 498 500 499 int pthread_cond_broadcast(pthread_cond_t * cond) libcfa_public __THROW {501 int pthread_cond_broadcast(pthread_cond_t *cond) libcfa_public __THROW { 500 502 check_nonnull(cond); 501 503 return notify_all(*get(cond)); 502 504 } // pthread_cond_broadcast 503 505 504 int pthread_cond_destroy(pthread_cond_t * cond) libcfa_public __THROW {506 int pthread_cond_destroy(pthread_cond_t *cond) libcfa_public __THROW { 505 507 check_nonnull(cond); 506 508 destroy(cond); … … 512 514 //######################### Local storage ######################### 513 515 514 int pthread_once(pthread_once_t * once_control, void (*init_routine)(void)) libcfa_public __THROW {516 int pthread_once(pthread_once_t *once_control, void (*init_routine)(void)) libcfa_public __THROW { 515 517 static_assert(sizeof(pthread_once_t) >= sizeof(int),"sizeof(pthread_once_t) < sizeof(int)"); 516 518 check_nonnull(once_control); … … 525 527 } // pthread_once 526 528 527 int pthread_key_create( pthread_key_t * key, void (*destructor)( void * ) ) libcfa_public __THROW {529 int pthread_key_create( pthread_key_t *key, void (*destructor)( void * ) ) libcfa_public __THROW { 528 530 lock(key_lock); 529 531 for ( int i = 0; i < PTHREAD_KEYS_MAX; i += 1 ) { … … 560 562 } // pthread_key_delete 561 563 562 int pthread_setspecific( pthread_key_t key, const void * value ) libcfa_public __THROW {564 int pthread_setspecific( pthread_key_t key, const void *value ) libcfa_public __THROW { 563 565 // get current thread 564 cfaPthread * t = lookup(pthread_self());566 cfaPthread* t = lookup(pthread_self()); 565 567 // if current thread's pthreadData is NULL; initialize it 566 pthread_values * values;567 if (t->pthreadData == NULL) {568 pthread_values* values; 569 if (t->pthreadData == NULL){ 568 570 values = anew( PTHREAD_KEYS_MAX); 569 571 t->pthreadData = values; 570 for ( int i = 0;i < PTHREAD_KEYS_MAX; i++ ){572 for (int i = 0;i < PTHREAD_KEYS_MAX; i++){ 571 573 t->pthreadData[i].in_use = false; 572 574 } // for … … 591 593 } //pthread_setspecific 592 594 593 void * pthread_getspecific(pthread_key_t key) libcfa_public __THROW {595 void* pthread_getspecific(pthread_key_t key) libcfa_public __THROW { 594 596 if (key >= PTHREAD_KEYS_MAX || ! cfa_pthread_keys[key].in_use) return NULL; 595 597 596 598 // get current thread 597 cfaPthread * t = lookup(pthread_self());599 cfaPthread* t = lookup(pthread_self()); 598 600 if (t->pthreadData == NULL) return NULL; 599 601 lock(key_lock); 600 pthread_values & entry = ((pthread_values *)t->pthreadData)[key];602 pthread_values &entry = ((pthread_values *)t->pthreadData)[key]; 601 603 if ( ! entry.in_use ) { 602 604 unlock( key_lock ); 603 605 return NULL; 604 606 } // if 605 void * value = entry.value;607 void *value = entry.value; 606 608 unlock(key_lock); 607 609 … … 873 875 //######################### Parallelism ######################### 874 876 875 //int pthread_setaffinity_np( pthread_t /* __th */, size_t /* __cpusetsize */, __const cpu_set_t * /* __cpuset */ ) libcfa_public __THROW {876 //abort( "pthread_setaffinity_np" );877 //} // pthread_setaffinity_np878 879 //int pthread_getaffinity_np( pthread_t /* __th */, size_t /* __cpusetsize */, cpu_set_t * /* __cpuset */ ) libcfa_public __THROW {880 //abort( "pthread_getaffinity_np" );881 //} // pthread_getaffinity_np882 883 //int pthread_attr_setaffinity_np( pthread_attr_t * /* __attr */, size_t /* __cpusetsize */, __const cpu_set_t * /* __cpuset */ ) libcfa_public __THROW {884 //abort( "pthread_attr_setaffinity_np" );885 //} // pthread_attr_setaffinity_np886 887 //int pthread_attr_getaffinity_np( __const pthread_attr_t * /* __attr */, size_t /* __cpusetsize */, cpu_set_t * /* __cpuset */ ) libcfa_public __THROW {888 //abort( "pthread_attr_getaffinity_np" );889 //} // pthread_attr_getaffinity_np877 int pthread_setaffinity_np( pthread_t /* __th */, size_t /* __cpusetsize */, __const cpu_set_t * /* __cpuset */ ) libcfa_public __THROW { 878 abort( "pthread_setaffinity_np" ); 879 } // pthread_setaffinity_np 880 881 int pthread_getaffinity_np( pthread_t /* __th */, size_t /* __cpusetsize */, cpu_set_t * /* __cpuset */ ) libcfa_public __THROW { 882 abort( "pthread_getaffinity_np" ); 883 } // pthread_getaffinity_np 884 885 int pthread_attr_setaffinity_np( pthread_attr_t * /* __attr */, size_t /* __cpusetsize */, __const cpu_set_t * /* __cpuset */ ) libcfa_public __THROW { 886 abort( "pthread_attr_setaffinity_np" ); 887 } // pthread_attr_setaffinity_np 888 889 int pthread_attr_getaffinity_np( __const pthread_attr_t * /* __attr */, size_t /* __cpusetsize */, cpu_set_t * /* __cpuset */ ) libcfa_public __THROW { 890 abort( "pthread_attr_getaffinity_np" ); 891 } // pthread_attr_getaffinity_np 890 892 891 893 //######################### Cancellation ######################### … … 904 906 } // pthread_cancel 905 907 906 int pthread_setcancelstate( int state, int * oldstate ) libcfa_public __THROW {908 int pthread_setcancelstate( int state, int *oldstate ) libcfa_public __THROW { 907 909 abort("pthread_setcancelstate not implemented"); 908 910 return 0; 909 911 } // pthread_setcancelstate 910 912 911 int pthread_setcanceltype( int type, int * oldtype ) libcfa_public __THROW {913 int pthread_setcanceltype( int type, int *oldtype ) libcfa_public __THROW { 912 914 abort("pthread_setcanceltype not implemented"); 913 915 return 0; … … 916 918 917 919 #pragma GCC diagnostic pop 920
Note:
See TracChangeset
for help on using the changeset viewer.