Ignore:
Timestamp:
Mar 15, 2017, 4:20:26 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
29f44a74
Parents:
84c52a8
Message:

Renamed thread to thread_desc

File:
1 edited

Legend:

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

    r84c52a8 r348006f  
    4343KERNEL_STORAGE(cluster, systemCluster);
    4444KERNEL_STORAGE(processor, systemProcessor);
    45 KERNEL_STORAGE(thread, mainThread);
     45KERNEL_STORAGE(thread_desc, mainThread);
    4646KERNEL_STORAGE(machine_context_t, mainThread_context);
    4747
    4848cluster * systemCluster;
    4949processor * systemProcessor;
    50 thread * mainThread;
     50thread_desc * mainThread;
    5151
    5252//-----------------------------------------------------------------------------
     
    5959}
    6060
    61 thread * this_thread(void) {
     61thread_desc * this_thread(void) {
    6262        return this_processor->current_thread;
    6363}
     
    106106}
    107107
    108 void ?{}( thread * this, current_stack_info_t * info) {
     108void ?{}( thread_desc * this, current_stack_info_t * info) {
    109109        (&this->c){ info };
    110110}
     
    175175        LIB_DEBUG_PRINTF("Kernel : core %p starting\n", this);
    176176
    177         thread * readyThread = NULL;
     177        thread_desc * readyThread = NULL;
    178178        for( unsigned int spin_count = 0; ! this->is_terminated; spin_count++ )
    179179        {
     
    202202// runThread runs a thread by context switching
    203203// from the processor coroutine to the target thread
    204 void runThread(processor * this, thread * dst) {
     204void runThread(processor * this, thread_desc * dst) {
    205205        coroutine_desc * proc_cor = get_coroutine(this->runner);
    206206        coroutine_desc * thrd_cor = get_coroutine(dst);
     
    293293//-----------------------------------------------------------------------------
    294294// Scheduler routines
    295 void ScheduleThread( thread * thrd ) {
     295void ScheduleThread( thread_desc * thrd ) {
    296296        assertf( thrd->next == NULL, "Expected null got %p", thrd->next );
    297297       
     
    301301}
    302302
    303 thread * nextThread(cluster * this) {
     303thread_desc * nextThread(cluster * this) {
    304304        lock( &this->lock );
    305         thread * head = pop_head( &this->ready_queue );
     305        thread_desc * head = pop_head( &this->ready_queue );
    306306        unlock( &this->lock );
    307307        return head;
     
    318318}
    319319
    320 void ScheduleInternal( thread * thrd ) {
     320void ScheduleInternal( thread_desc * thrd ) {
    321321        this_processor->finish.action_code = Schedule;
    322322        this_processor->finish.thrd = thrd;
     
    324324}
    325325
    326 void ScheduleInternal( spinlock * lock, thread * thrd ) {
     326void ScheduleInternal( spinlock * lock, thread_desc * thrd ) {
    327327        this_processor->finish.action_code = Release_Schedule;
    328328        this_processor->finish.lock = lock;
     
    339339        // SKULLDUGGERY: the mainThread steals the process main thread
    340340        // which will then be scheduled by the systemProcessor normally
    341         mainThread = (thread *)&mainThread_storage;
     341        mainThread = (thread_desc *)&mainThread_storage;
    342342        current_stack_info_t info;
    343343        mainThread{ &info };
     
    436436                this->condition = true;
    437437
    438                 thread * it;
     438                thread_desc * it;
    439439                while( it = pop_head( &this->blocked) ) {
    440440                        ScheduleThread( it );
     
    451451}
    452452
    453 void append( simple_thread_list * this, thread * t ) {
     453void append( simple_thread_list * this, thread_desc * t ) {
    454454        assert(this->tail != NULL);
    455455        *this->tail = t;
     
    457457}
    458458
    459 thread * pop_head( simple_thread_list * this ) {
    460         thread * head = this->head;
     459thread_desc * pop_head( simple_thread_list * this ) {
     460        thread_desc * head = this->head;
    461461        if( head ) {
    462462                this->head = head->next;
Note: See TracChangeset for help on using the changeset viewer.