Ignore:
Timestamp:
Aug 3, 2022, 6:32:06 PM (2 years ago)
Author:
z277zhu <z277zhu@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
20be782
Parents:
80d16f8
git-author:
z277zhu <z277zhu@…> (08/03/22 18:24:16)
git-committer:
z277zhu <z277zhu@…> (08/03/22 18:32:06)
Message:

added pthread symbol interpose

Signed-off-by: z277zhu <z277zhu@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel/startup.cfa

    r80d16f8 ra7d696f  
    218218                ( this.runner ){};
    219219                init( this, "Main Processor", *mainCluster, 0p );
    220                 kernel_thread = pthread_self();
     220                kernel_thread = real_pthread_self();
    221221
    222222                runner{ &this };
     
    769769        pthread_attr_t attr;
    770770
    771         check( pthread_attr_init( &attr ), "pthread_attr_init" ); // initialize attribute
     771        check( real_pthread_attr_init( &attr ), "pthread_attr_init" ); // initialize attribute
    772772
    773773        size_t stacksize = max( PTHREAD_STACK_MIN, DEFAULT_STACK_SIZE );
     
    796796        #endif
    797797
    798         check( pthread_attr_setstack( &attr, stack, stacksize ), "pthread_attr_setstack" );
    799         check( pthread_create( pthread, &attr, start, arg ), "pthread_create" );
     798        check( real_pthread_attr_setstack( &attr, stack, stacksize ), "pthread_attr_setstack" );
     799        check( real_pthread_create( pthread, &attr, start, arg ), "pthread_create" );
    800800        return stack;
    801801}
    802802
    803803void __destroy_pthread( pthread_t pthread, void * stack, void ** retval ) {
    804         int err = pthread_join( pthread, retval );
     804        int err = real_pthread_join( pthread, retval );
    805805        if( err != 0 ) abort("KERNEL ERROR: joining pthread %p caused error %s\n", (void*)pthread, strerror(err));
    806806
     
    808808                pthread_attr_t attr;
    809809
    810                 check( pthread_attr_init( &attr ), "pthread_attr_init" ); // initialize attribute
     810                check( real_pthread_attr_init( &attr ), "pthread_attr_init" ); // initialize attribute
    811811
    812812                size_t stacksize;
    813813                // default stack size, normally defined by shell limit
    814                 check( pthread_attr_getstacksize( &attr, &stacksize ), "pthread_attr_getstacksize" );
     814                check( real_pthread_attr_getstacksize( &attr, &stacksize ), "pthread_attr_getstacksize" );
    815815                assert( stacksize >= PTHREAD_STACK_MIN );
    816816                stacksize += __page_size;
Note: See TracChangeset for help on using the changeset viewer.