Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/pthread.cfa

    rff443e5 r8bd886e  
    1515
    1616#define __cforall_thread__
     17#define _GNU_SOURCE
    1718
    1819#include <signal.h>
     
    3435struct pthread_values{
    3536        inline Seqable;
    36         void * value;
     37        void* value;
    3738        bool in_use;
    3839};
     
    5051struct pthread_keys {
    5152        bool in_use;
    52         void (* destructor)( void * );
     53        void (*destructor)( void * );
    5354        Sequence(pthread_values) threads;
    5455};
    5556
    56 static void ?{}(pthread_keys& k) {
     57static void ?{}(pthread_keys& k){
    5758        k.threads{};
    5859}
     
    6162static pthread_keys cfa_pthread_keys_storage[PTHREAD_KEYS_MAX] __attribute__((aligned (16)));
    6263
    63 static void init_pthread_storage() {
    64         for ( int i = 0; i < PTHREAD_KEYS_MAX; i++ ) {
     64static void init_pthread_storage(){
     65        for (int i = 0; i < PTHREAD_KEYS_MAX; i++){
    6566                cfa_pthread_keys_storage[i]{};
    6667        }
     
    9596
    9697/* condvar helper routines */
    97 static void init(pthread_cond_t * pcond) {
     98static void init(pthread_cond_t* pcond){
    9899        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;
    100101        ?{}(*_cond);
    101102}
    102103
    103 static cfa2pthr_cond_var_t * get(pthread_cond_t * pcond) {
     104static cfa2pthr_cond_var_t* get(pthread_cond_t* pcond){
    104105        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
     109static void destroy(pthread_cond_t* cond){
    109110        static_assert(sizeof(pthread_cond_t) >= sizeof(cfa2pthr_cond_var_t),"sizeof(pthread_t) < sizeof(cfa2pthr_cond_var_t)");
    110111        ^?{}(*get(cond));
     
    115116
    116117/* mutex helper routines */
    117 static void mutex_check(pthread_mutex_t * t) {
     118static void mutex_check(pthread_mutex_t* t){
    118119        // Use double check to improve performance.
    119120        // 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;
    121122
    122123        // SKULLDUGGERY: not a portable way to access the kind field, /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h
     
    135136
    136137
    137 static void init(pthread_mutex_t * plock) {
     138static void init(pthread_mutex_t* plock){
    138139        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;
    140141        ?{}(*_lock);
    141142}
    142143
    143 static simple_owner_lock * get(pthread_mutex_t * plock) {
     144static simple_owner_lock* get(pthread_mutex_t* plock){
    144145        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
     149static void destroy(pthread_mutex_t* plock){
    149150        static_assert(sizeof(pthread_mutex_t) >= sizeof(simple_owner_lock),"sizeof(pthread_mutex_t) < sizeof(simple_owner_lock)");
    150151        ^?{}(*get(plock));
     
    152153
    153154//######################### Attr helpers #########################
    154 typedef struct cfaPthread_attr_t {                                              // thread attributes
     155struct cfaPthread_attr_t {                                                              // thread attributes
    155156                int contentionscope;
    156157                int detachstate;
    157158                size_t stacksize;
    158                 void * stackaddr;
     159                void *stackaddr;
    159160                int policy;
    160161                int inheritsched;
    161162                struct sched_param param;
    162 } cfaPthread_attr_t;
    163 
    164 static const cfaPthread_attr_t default_attrs {
     163} typedef cfaPthread_attr_t;
     164
     165static const cfaPthread_attr_t default_attrs{
    165166        0,
    166167        0,
    167         65_000,
    168         NULL,
     168        (size_t)65000,
     169        (void *)NULL,
    169170        0,
    170171        0,
     
    172173};
    173174
    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;
     175static 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;
    177178}
    178179
     
    189190
    190191        // pthreads return value
    191         void * joinval;
     192        void *joinval;
    192193
    193194        // pthread attributes
    194195        pthread_attr_t pthread_attr;
    195196
    196         void *(* start_routine)(void *);
    197         void * start_arg;
     197        void *(*start_routine)(void *);
     198        void *start_arg;
    198199
    199200        // thread local data
    200         pthread_values * pthreadData;
     201        pthread_values* pthreadData;
    201202
    202203        // flag used for tryjoin
     
    206207/* thread part routines */
    207208//  cfaPthread entry point
    208 void main(cfaPthread & _thread) with(_thread) {
    209         joinval = start_routine(start_arg);
     209void main(cfaPthread& _thread) with(_thread){
     210        joinval =  start_routine(start_arg);
    210211        isTerminated = true;
    211212}
    212213
    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::invokeTask
    219         pthread_values * value;
    220         pthread_keys * key;
     214static cfaPthread *lookup( pthread_t p ){
     215        static_assert(sizeof(pthread_t) >= sizeof(cfaPthread*),"sizeof(pthread_t) < sizeof(cfaPthread*)");
     216        return (cfaPthread*)p;
     217}
     218
     219static void pthread_deletespecific_( pthread_values* values )  { // see uMachContext::invokeTask
     220        pthread_values* value;
     221        pthread_keys* key;
    221222        bool destcalled = true;
    222         if (values != NULL) {
     223        if (values != NULL){
    223224                for ( int attempts = 0; attempts < PTHREAD_DESTRUCTOR_ITERATIONS && destcalled ; attempts += 1 ) {
    224225                        destcalled = false;
    225226                        lock(key_lock);
    226                         for ( int i = 0; i < PTHREAD_KEYS_MAX; i++ ) {
     227                        for (int i = 0; i < PTHREAD_KEYS_MAX; i++){
    227228                                // for each valid key
    228                                 if ( values[i].in_use) {
     229                                if ( values[i].in_use){
    229230                                        value = &values[i];
    230231                                        key = &cfa_pthread_keys[i];
     
    233234                                        // if  a  key  value  has  a  non-NULL  destructor pointer,  and  the  thread  has  a  non-NULL  value associated with that key,
    234235                                        // 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){
    236237                                                unlock(key_lock);
    237238                                                key->destructor(value->value); // run destructor
     
    248249}
    249250
    250 static void ^?{}(cfaPthread & mutex t) {
     251static void ^?{}(cfaPthread & mutex t){
    251252        // delete pthread local storage
    252253        pthread_values * values = t.pthreadData;
     
    254255}
    255256
    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 *)");
     257static 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*)");
    258259
    259260        // set up user thread stackSize
     
    277278        //######################### Pthread Attrs #########################
    278279
    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);
    281282                ?{}(*_attr, default_attrs);
    282283                return 0;
    283284        }
    284         int pthread_attr_destroy(pthread_attr_t * attr) libcfa_public __THROW {
     285        int pthread_attr_destroy(pthread_attr_t *attr) libcfa_public __THROW {
    285286                ^?{}(*get(attr));
    286287                return 0;
    287288        }
    288289
    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 {
    290291                get( attr )->contentionscope = contentionscope;
    291292                return 0;
    292293        } // pthread_attr_setscope
    293294
    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 {
    295296                *contentionscope = get( attr )->contentionscope;
    296297                return 0;
    297298        } // pthread_attr_getscope
    298299
    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 {
    300301                get( attr )->detachstate = detachstate;
    301302                return 0;
    302303        } // pthread_attr_setdetachstate
    303304
    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 {
    305306                *detachstate = get( attr )->detachstate;
    306307                return 0;
    307308        } // pthread_attr_getdetachstate
    308309
    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 {
    310311                get( attr )->stacksize = stacksize;
    311312                return 0;
    312313        } // pthread_attr_setstacksize
    313314
    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 {
    315316                *stacksize = get( attr )->stacksize;
    316317                return 0;
     
    325326        } // pthread_attr_setguardsize
    326327
    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 {
    328329                get( attr )->stackaddr = stackaddr;
    329330                return 0;
    330331        } // pthread_attr_setstackaddr
    331332
    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 {
    333334                *stackaddr = get( attr )->stackaddr;
    334335                return 0;
    335336        } // pthread_attr_getstackaddr
    336337
    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 {
    338339                get( attr )->stackaddr = stackaddr;
    339340                get( attr )->stacksize = stacksize;
     
    341342        } // pthread_attr_setstack
    342343
    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 {
    344345                *stackaddr = get( attr )->stackaddr;
    345346                *stacksize = get( attr )->stacksize;
     
    350351        // already running thread threadID. It shall be called on unitialized attr
    351352        // 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 extension
     353        int pthread_getattr_np( pthread_t threadID, pthread_attr_t *attr ) libcfa_public __THROW { // GNU extension
    353354                check_nonnull(attr);
    354355
     
    362363        //######################### Threads #########################
    363364
    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();
    366367                (*t){_thread, attr, start_routine, arg};
    367368                return 0;
    368369        }
    369370
    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 {
    371373                // if thread is invalid
    372374                if (_thread == NULL) return EINVAL;
     
    374376
    375377                // get user thr pointer
    376                 cfaPthread * p = lookup(_thread);
     378                cfaPthread* p = lookup(_thread);
    377379                try {
    378380                        join(*p);
     
    387389        }
    388390
    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 {
    390392                // if thread is invalid
    391393                if (_thread == NULL) return EINVAL;
    392394                if (_thread == pthread_self()) return EDEADLK;
    393395
    394                 cfaPthread * p = lookup(_thread);
     396                cfaPthread* p = lookup(_thread);
    395397
    396398                // thread not finished ?
     
    410412        void pthread_exit(void * status) libcfa_public __THROW {
    411413                pthread_t pid = pthread_self();
    412                 cfaPthread * _thread = (cfaPthread *)pid;
     414                cfaPthread* _thread = (cfaPthread*)pid;
    413415                _thread->joinval = status;  // set return value
    414416                _thread->isTerminated = 1;  // set terminated flag
     
    424426        //######################### Mutex #########################
    425427
    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 {
    427429                check_nonnull(_mutex);
    428430                init(_mutex);
     
    433435        int pthread_mutex_destroy(pthread_mutex_t *_mutex) libcfa_public __THROW {
    434436                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){
    437439                        return EBUSY;
    438440                }
     
    444446                check_nonnull(_mutex);
    445447                mutex_check(_mutex);
    446                 simple_owner_lock * _lock = get(_mutex);
     448                simple_owner_lock* _lock = get(_mutex);
    447449                lock(*_lock);
    448450                return 0;
     
    451453        int pthread_mutex_unlock(pthread_mutex_t *_mutex) libcfa_public __THROW {
    452454                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()){
    455457                        return EPERM;
    456458                } // current thread does not hold the mutex
     
    461463        int pthread_mutex_trylock(pthread_mutex_t *_mutex) libcfa_public __THROW {
    462464                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){
    465467                        return EBUSY;
    466468                }   // if mutex is owned
     
    472474
    473475        /* 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 {
    475477                check_nonnull(cond);
    476478                init(cond);
     
    478480        }  //pthread_cond_init
    479481
    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 {
    481483                check_nonnull(_mutex);
    482484                check_nonnull(cond);
     
    492494        } // pthread_cond_timedwait
    493495
    494         int pthread_cond_signal(pthread_cond_t * cond) libcfa_public __THROW {
     496        int pthread_cond_signal(pthread_cond_t *cond) libcfa_public __THROW {
    495497                check_nonnull(cond);
    496498                return notify_one(*get(cond));
    497499        } // pthread_cond_signal
    498500
    499         int pthread_cond_broadcast(pthread_cond_t * cond) libcfa_public __THROW {
     501        int pthread_cond_broadcast(pthread_cond_t *cond) libcfa_public __THROW {
    500502                check_nonnull(cond);
    501503                return notify_all(*get(cond));
    502504        } // pthread_cond_broadcast
    503505
    504         int pthread_cond_destroy(pthread_cond_t * cond) libcfa_public __THROW {
     506        int pthread_cond_destroy(pthread_cond_t *cond) libcfa_public __THROW {
    505507                check_nonnull(cond);
    506508                destroy(cond);
     
    512514        //######################### Local storage #########################
    513515
    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 {
    515517                static_assert(sizeof(pthread_once_t) >= sizeof(int),"sizeof(pthread_once_t) < sizeof(int)");
    516518                check_nonnull(once_control);
     
    525527        } // pthread_once
    526528
    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 {
    528530                lock(key_lock);
    529531                for ( int i = 0; i < PTHREAD_KEYS_MAX; i += 1 ) {
     
    560562        }   // pthread_key_delete
    561563
    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 {
    563565                // get current thread
    564                 cfaPthread * t = lookup(pthread_self());
     566                cfaPthread* t = lookup(pthread_self());
    565567                // 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){
    568570                        values = anew( PTHREAD_KEYS_MAX);
    569571                        t->pthreadData = values;
    570                         for ( int i = 0;i < PTHREAD_KEYS_MAX; i++ ) {
     572                        for (int i = 0;i < PTHREAD_KEYS_MAX; i++){
    571573                                t->pthreadData[i].in_use = false;
    572574                        }   // for
     
    591593        } //pthread_setspecific
    592594
    593         void * pthread_getspecific(pthread_key_t key) libcfa_public __THROW {
     595        void* pthread_getspecific(pthread_key_t key) libcfa_public __THROW {
    594596                if (key >= PTHREAD_KEYS_MAX || ! cfa_pthread_keys[key].in_use) return NULL;
    595597
    596598                // get current thread
    597                 cfaPthread * t = lookup(pthread_self());
     599                cfaPthread* t = lookup(pthread_self());
    598600                if (t->pthreadData == NULL) return NULL;
    599601                lock(key_lock);
    600                 pthread_values & entry = ((pthread_values *)t->pthreadData)[key];
     602                pthread_values &entry = ((pthread_values *)t->pthreadData)[key];
    601603                if ( ! entry.in_use ) {
    602604                        unlock( key_lock );
    603605                        return NULL;
    604606                } // if
    605                 void * value = entry.value;
     607                void *value = entry.value;
    606608                unlock(key_lock);
    607609
     
    873875        //######################### Parallelism #########################
    874876
    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_np
    878 
    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_np
    882 
    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_np
    886 
    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_np
     877        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
    890892
    891893        //######################### Cancellation #########################
     
    904906        } // pthread_cancel
    905907
    906         int pthread_setcancelstate( int state, int * oldstate ) libcfa_public __THROW {
     908        int pthread_setcancelstate( int state, int *oldstate ) libcfa_public __THROW {
    907909                abort("pthread_setcancelstate not implemented");
    908910                return 0;
    909911        } // pthread_setcancelstate
    910912
    911         int pthread_setcanceltype( int type, int * oldtype ) libcfa_public __THROW {
     913        int pthread_setcanceltype( int type, int *oldtype ) libcfa_public __THROW {
    912914                abort("pthread_setcanceltype not implemented");
    913915                return 0;
     
    916918
    917919#pragma GCC diagnostic pop
     920
Note: See TracChangeset for help on using the changeset viewer.