Ignore:
Timestamp:
Feb 24, 2020, 2:21:03 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
959f6ad
Parents:
0f2c555
Message:

Changed descriptors for concurrency to use $ prefix instead of trailing _desc

File:
1 edited

Legend:

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

    r0f2c555 rac2b598  
    117117KERNEL_STORAGE(cluster,         mainCluster);
    118118KERNEL_STORAGE(processor,       mainProcessor);
    119 KERNEL_STORAGE(thread_desc,     mainThread);
     119KERNEL_STORAGE($thread, mainThread);
    120120KERNEL_STORAGE(__stack_t,       mainThreadCtx);
    121121
    122122cluster     * mainCluster;
    123123processor   * mainProcessor;
    124 thread_desc * mainThread;
     124$thread * mainThread;
    125125
    126126extern "C" {
     
    164164// Main thread construction
    165165
    166 void ?{}( coroutine_desc & this, current_stack_info_t * info) with( this ) {
     166void ?{}( $coroutine & this, current_stack_info_t * info) with( this ) {
    167167        stack.storage = info->storage;
    168168        with(*stack.storage) {
     
    179179}
    180180
    181 void ?{}( thread_desc & this, current_stack_info_t * info) with( this ) {
     181void ?{}( $thread & this, current_stack_info_t * info) with( this ) {
    182182        state = Start;
    183183        self_cor{ info };
     
    264264// Kernel Scheduling logic
    265265//=============================================================================================
    266 static thread_desc * __next_thread(cluster * this);
    267 static void __run_thread(processor * this, thread_desc * dst);
     266static $thread * __next_thread(cluster * this);
     267static void __run_thread(processor * this, $thread * dst);
    268268static void __halt(processor * this);
    269269
     
    287287                __cfaabi_dbg_print_safe("Kernel : core %p started\n", this);
    288288
    289                 thread_desc * readyThread = 0p;
     289                $thread * readyThread = 0p;
    290290                for( unsigned int spin_count = 0; ! __atomic_load_n(&this->do_terminate, __ATOMIC_SEQ_CST); spin_count++ ) {
    291291                        readyThread = __next_thread( this->cltr );
     
    323323// runThread runs a thread by context switching
    324324// from the processor coroutine to the target thread
    325 static void __run_thread(processor * this, thread_desc * thrd_dst) {
    326         coroutine_desc * proc_cor = get_coroutine(this->runner);
     325static void __run_thread(processor * this, $thread * thrd_dst) {
     326        $coroutine * proc_cor = get_coroutine(this->runner);
    327327
    328328        // Update global state
     
    400400void returnToKernel() {
    401401        /* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
    402         coroutine_desc * proc_cor = get_coroutine(kernelTLS.this_processor->runner);
    403         thread_desc * thrd_src = kernelTLS.this_thread;
     402        $coroutine * proc_cor = get_coroutine(kernelTLS.this_processor->runner);
     403        $thread * thrd_src = kernelTLS.this_thread;
    404404
    405405        // Run the thread on this processor
     
    495495// KERNEL_ONLY
    496496static void __kernel_first_resume( processor * this ) {
    497         thread_desc * src = mainThread;
    498         coroutine_desc * dst = get_coroutine(this->runner);
     497        $thread * src = mainThread;
     498        $coroutine * dst = get_coroutine(this->runner);
    499499
    500500        verify( ! kernelTLS.preemption_state.enabled );
     
    527527// KERNEL_ONLY
    528528static void __kernel_last_resume( processor * this ) {
    529         coroutine_desc * src = &mainThread->self_cor;
    530         coroutine_desc * dst = get_coroutine(this->runner);
     529        $coroutine * src = &mainThread->self_cor;
     530        $coroutine * dst = get_coroutine(this->runner);
    531531
    532532        verify( ! kernelTLS.preemption_state.enabled );
     
    541541// Scheduler routines
    542542// KERNEL ONLY
    543 void __schedule_thread( thread_desc * thrd ) with( *thrd->curr_cluster ) {
     543void __schedule_thread( $thread * thrd ) with( *thrd->curr_cluster ) {
    544544        /* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
    545545        /* paranoid */ #if defined( __CFA_WITH_VERIFY__ )
     
    571571
    572572// KERNEL ONLY
    573 static thread_desc * __next_thread(cluster * this) with( *this ) {
     573static $thread * __next_thread(cluster * this) with( *this ) {
    574574        /* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
    575575
    576576        lock( ready_queue_lock __cfaabi_dbg_ctx2 );
    577         thread_desc * head = pop_head( ready_queue );
     577        $thread * head = pop_head( ready_queue );
    578578        unlock( ready_queue_lock );
    579579
     
    582582}
    583583
    584 void unpark( thread_desc * thrd ) {
     584void unpark( $thread * thrd ) {
    585585        if( !thrd ) return;
    586586
     
    639639        /* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
    640640
    641         thread_desc * thrd = kernelTLS.this_thread;
     641        $thread * thrd = kernelTLS.this_thread;
    642642        /* paranoid */ verify(thrd->state == Active || thrd->state == Rerun);
    643643
     
    683683        // SKULLDUGGERY: the mainThread steals the process main thread
    684684        // which will then be scheduled by the mainProcessor normally
    685         mainThread = (thread_desc *)&storage_mainThread;
     685        mainThread = ($thread *)&storage_mainThread;
    686686        current_stack_info_t info;
    687687        info.storage = (__stack_t*)&storage_mainThreadCtx;
     
    835835
    836836void kernel_abort_msg( void * kernel_data, char * abort_text, int abort_text_size ) {
    837         thread_desc * thrd = kernel_data;
     837        $thread * thrd = kernel_data;
    838838
    839839        if(thrd) {
     
    900900
    901901void V(semaphore & this) with( this ) {
    902         thread_desc * thrd = 0p;
     902        $thread * thrd = 0p;
    903903        lock( lock __cfaabi_dbg_ctx2 );
    904904        count += 1;
     
    928928}
    929929
    930 void doregister( cluster * cltr, thread_desc & thrd ) {
     930void doregister( cluster * cltr, $thread & thrd ) {
    931931        lock      (cltr->thread_list_lock __cfaabi_dbg_ctx2);
    932932        cltr->nthreads += 1;
     
    935935}
    936936
    937 void unregister( cluster * cltr, thread_desc & thrd ) {
     937void unregister( cluster * cltr, $thread & thrd ) {
    938938        lock  (cltr->thread_list_lock __cfaabi_dbg_ctx2);
    939939        remove(cltr->threads, thrd );
Note: See TracChangeset for help on using the changeset viewer.