Ignore:
Timestamp:
Sep 21, 2022, 11:56:16 AM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
9cd5bd2
Parents:
7f6a7c9
Message:

Changed real_pthread symbols (now cfaabi_pthread) to be protected in libcfathread

Location:
libcfa/src/concurrency/kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel/private.hfa

    r7f6a7c9 r95dab9e  
    4949#endif
    5050
     51extern "C" {
     52        __attribute__((visibility("protected"))) int __cfaabi_pthread_create(pthread_t *_thread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg);
     53        __attribute__((visibility("protected"))) int __cfaabi_pthread_join(pthread_t _thread, void **retval);
     54        __attribute__((visibility("protected"))) pthread_t __cfaabi_pthread_self(void);
     55        __attribute__((visibility("protected"))) int __cfaabi_pthread_attr_init(pthread_attr_t *attr);
     56        __attribute__((visibility("protected"))) int __cfaabi_pthread_attr_destroy(pthread_attr_t *attr);
     57        __attribute__((visibility("protected"))) int __cfaabi_pthread_attr_setstack( pthread_attr_t *attr, void *stackaddr, size_t stacksize );
     58        __attribute__((visibility("protected"))) int __cfaabi_pthread_attr_getstacksize( const pthread_attr_t *attr, size_t *stacksize );
     59        __attribute__((visibility("protected"))) int __cfaabi_pthread_sigqueue(pthread_t _thread, int sig, const union sigval value);
     60        __attribute__((visibility("protected"))) int __cfaabi_pthread_sigmask( int how, const sigset_t *set, sigset_t *oset);
     61}
     62
    5163//-----------------------------------------------------------------------------
    5264// Scheduler
  • libcfa/src/concurrency/kernel/startup.cfa

    r7f6a7c9 r95dab9e  
    219219                ( this.runner ){};
    220220                init( this, "Main Processor", *mainCluster, 0p );
    221                 kernel_thread = real_pthread_self();
     221                kernel_thread = __cfaabi_pthread_self();
    222222
    223223                runner{ &this };
     
    779779        pthread_attr_t attr;
    780780
    781         check( real_pthread_attr_init( &attr ), "pthread_attr_init" ); // initialize attribute
     781        check( __cfaabi_pthread_attr_init( &attr ), "pthread_attr_init" ); // initialize attribute
    782782
    783783        size_t stacksize = max( PTHREAD_STACK_MIN, DEFAULT_STACK_SIZE );
     
    806806        #endif
    807807
    808         check( real_pthread_attr_setstack( &attr, stack, stacksize ), "pthread_attr_setstack" );
    809         check( real_pthread_create( pthread, &attr, start, arg ), "pthread_create" );
     808        check( __cfaabi_pthread_attr_setstack( &attr, stack, stacksize ), "pthread_attr_setstack" );
     809        check( __cfaabi_pthread_create( pthread, &attr, start, arg ), "pthread_create" );
    810810        return stack;
    811811}
    812812
    813813void __destroy_pthread( pthread_t pthread, void * stack, void ** retval ) {
    814         int err = real_pthread_join( pthread, retval );
     814        int err = __cfaabi_pthread_join( pthread, retval );
    815815        if( err != 0 ) abort("KERNEL ERROR: joining pthread %p caused error %s\n", (void*)pthread, strerror(err));
    816816
     
    818818                pthread_attr_t attr;
    819819
    820                 check( real_pthread_attr_init( &attr ), "pthread_attr_init" ); // initialize attribute
     820                check( __cfaabi_pthread_attr_init( &attr ), "pthread_attr_init" ); // initialize attribute
    821821
    822822                size_t stacksize;
    823823                // default stack size, normally defined by shell limit
    824                 check( real_pthread_attr_getstacksize( &attr, &stacksize ), "pthread_attr_getstacksize" );
     824                check( __cfaabi_pthread_attr_getstacksize( &attr, &stacksize ), "pthread_attr_getstacksize" );
    825825                assert( stacksize >= PTHREAD_STACK_MIN );
    826826                stacksize += __page_size;
Note: See TracChangeset for help on using the changeset viewer.