source: src/libcfa/concurrency/kernel.c @ 807d8c3

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 807d8c3 was 807d8c3, checked in by Thierry Delisle <tdelisle@…>, 7 years ago

Disable migration of the main thread to help find a bug

  • Property mode set to 100644
File size: 20.9 KB
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// kernel.c --
8//
9// Author           : Thierry Delisle
10// Created On       : Tue Jan 17 12:27:26 2017
11// Last Modified By : Peter A. Buhr
12// Last Modified On : Thu Feb  8 23:52:19 2018
13// Update Count     : 5
14//
15
16//C Includes
17#include <stddef.h>
18extern "C" {
19#include <stdio.h>
20#include <fenv.h>
21#include <sys/resource.h>
22#include <signal.h>
23#include <unistd.h>
24}
25
26//CFA Includes
27#include "kernel_private.h"
28#include "preemption.h"
29#include "startup.h"
30
31//Private includes
32#define __CFA_INVOKE_PRIVATE__
33#include "invoke.h"
34
35//Start and stop routine for the kernel, declared first to make sure they run first
36void kernel_startup(void)  __attribute__(( constructor( STARTUP_PRIORITY_KERNEL ) ));
37void kernel_shutdown(void) __attribute__(( destructor ( STARTUP_PRIORITY_KERNEL ) ));
38
39//-----------------------------------------------------------------------------
40// Kernel storage
41KERNEL_STORAGE(cluster,           mainCluster);
42KERNEL_STORAGE(processor,         mainProcessor);
43KERNEL_STORAGE(processorCtx_t,    mainProcessorCtx);
44KERNEL_STORAGE(thread_desc,       mainThread);
45KERNEL_STORAGE(machine_context_t, mainThreadCtx);
46
47cluster *     mainCluster;
48processor *   mainProcessor;
49thread_desc * mainThread;
50
51//-----------------------------------------------------------------------------
52// Global state
53
54thread_local coroutine_desc * volatile this_coroutine;
55thread_local thread_desc *    volatile this_thread;
56thread_local processor *      volatile this_processor;
57
58// volatile thread_local bool preemption_in_progress = 0;
59// volatile thread_local bool preemption_enabled = false;
60// volatile thread_local unsigned short disable_preempt_count = 1;
61
62volatile thread_local __cfa_kernel_preemption_state_t preemption_state = { false, false, 1 };
63
64//-----------------------------------------------------------------------------
65// Main thread construction
66struct current_stack_info_t {
67        machine_context_t ctx;
68        unsigned int size;              // size of stack
69        void *base;                             // base of stack
70        void *storage;                  // pointer to stack
71        void *limit;                    // stack grows towards stack limit
72        void *context;                  // address of cfa_context_t
73        void *top;                              // address of top of storage
74};
75
76void ?{}( current_stack_info_t & this ) {
77        CtxGet( this.ctx );
78        this.base = this.ctx.FP;
79        this.storage = this.ctx.SP;
80
81        rlimit r;
82        getrlimit( RLIMIT_STACK, &r);
83        this.size = r.rlim_cur;
84
85        this.limit = (void *)(((intptr_t)this.base) - this.size);
86        this.context = &storage_mainThreadCtx;
87        this.top = this.base;
88}
89
90void ?{}( coStack_t & this, current_stack_info_t * info) with( this ) {
91        size      = info->size;
92        storage   = info->storage;
93        limit     = info->limit;
94        base      = info->base;
95        context   = info->context;
96        top       = info->top;
97        userStack = true;
98}
99
100void ?{}( coroutine_desc & this, current_stack_info_t * info) with( this ) {
101        stack{ info };
102        name = "Main Thread";
103        errno_ = 0;
104        state = Start;
105        starter = NULL;
106}
107
108void ?{}( thread_desc & this, current_stack_info_t * info) with( this ) {
109        self_cor{ info };
110        curr_cor = &self_cor;
111        self_mon.owner = &this;
112        self_mon.recursion = 1;
113        self_mon_p = &self_mon;
114        next = NULL;
115        __cfaabi_dbg_debug_do(
116                dbg_next = NULL;
117                dbg_prev = NULL;
118                __cfaabi_dbg_thread_register(&this);
119        )
120
121        monitors{ &self_mon_p, 1, (fptr_t)0 };
122}
123
124//-----------------------------------------------------------------------------
125// Processor coroutine
126
127// Construct the processor context of the main processor
128void ?{}(processorCtx_t & this, processor * proc) {
129        (this.__cor){ "Processor" };
130        this.__cor.starter = NULL;
131        this.proc = proc;
132        proc->runner = &this;
133}
134
135// Construct the processor context of non-main processors
136void ?{}(processorCtx_t & this, processor * proc, current_stack_info_t * info) {
137        (this.__cor){ info };
138        this.proc = proc;
139        proc->runner = &this;
140}
141
142void ?{}(processor & this) {
143        this{ mainCluster };
144}
145
146void ?{}(processor & this, cluster * cltr) with( this ) {
147        this.cltr = cltr;
148        terminated{ 0 };
149        do_terminate = false;
150        preemption_alarm = NULL;
151        pending_preemption = false;
152
153        start( &this );
154}
155
156void ?{}(processor & this, cluster * cltr, processorCtx_t & runner) with( this ) {
157        this.cltr = cltr;
158        terminated{ 0 };
159        do_terminate = false;
160        preemption_alarm = NULL;
161        pending_preemption = false;
162        kernel_thread = pthread_self();
163
164        this.runner = &runner;
165        __cfaabi_dbg_print_safe("Kernel : constructing main processor context %p\n", &runner);
166        runner{ &this };
167}
168
169void ^?{}(processor & this) with( this ){
170        if( ! do_terminate ) {
171                __cfaabi_dbg_print_safe("Kernel : core %p signaling termination\n", &this);
172                terminate(&this);
173                P( terminated );
174                pthread_join( kernel_thread, NULL );
175        }
176}
177
178void ?{}(cluster & this) with( this ) {
179        ready_queue{};
180        ready_queue_lock{};
181
182        preemption_rate = default_preemption();
183}
184
185void ^?{}(cluster & this) {
186
187}
188
189//=============================================================================================
190// Kernel Scheduling logic
191//=============================================================================================
192//Main of the processor contexts
193void main(processorCtx_t & runner) {
194        processor * this = runner.proc;
195
196        __cfaabi_dbg_print_safe("Kernel : core %p starting\n", this);
197
198        {
199                // Setup preemption data
200                preemption_scope scope = { this };
201
202                __cfaabi_dbg_print_safe("Kernel : core %p started\n", this);
203
204                thread_desc * readyThread = NULL;
205                for( unsigned int spin_count = 0; ! this->do_terminate; spin_count++ )
206                {
207                        readyThread = nextThread( this->cltr );
208
209                        if(readyThread)
210                        {
211                                verify( !preemption_state.enabled );
212
213                                runThread(this, readyThread);
214
215                                verify( !preemption_state.enabled );
216
217                                //Some actions need to be taken from the kernel
218                                finishRunning(this);
219
220                                spin_count = 0;
221                        }
222                        else
223                        {
224                                spin(this, &spin_count);
225                        }
226                }
227
228                __cfaabi_dbg_print_safe("Kernel : core %p stopping\n", this);
229        }
230
231        V( this->terminated );
232
233        __cfaabi_dbg_print_safe("Kernel : core %p terminated\n", this);
234}
235
236// runThread runs a thread by context switching
237// from the processor coroutine to the target thread
238void runThread(processor * this, thread_desc * dst) {
239        assert(dst->curr_cor);
240        coroutine_desc * proc_cor = get_coroutine(*this->runner);
241        coroutine_desc * thrd_cor = dst->curr_cor;
242
243        //Reset the terminating actions here
244        this->finish.action_code = No_Action;
245
246        //Update global state
247        this_thread = dst;
248
249        // Context Switch to the thread
250        ThreadCtxSwitch(proc_cor, thrd_cor);
251        // when ThreadCtxSwitch returns we are back in the processor coroutine
252}
253
254void returnToKernel() {
255        coroutine_desc * proc_cor = get_coroutine(*this_processor->runner);
256        coroutine_desc * thrd_cor = this_thread->curr_cor = this_coroutine;
257        ThreadCtxSwitch(thrd_cor, proc_cor);
258}
259
260// Once a thread has finished running, some of
261// its final actions must be executed from the kernel
262void finishRunning(processor * this) with( this->finish ) {
263        if( action_code == Release ) {
264                verify( !preemption_state.enabled );
265                unlock( *lock );
266        }
267        else if( action_code == Schedule ) {
268                ScheduleThread( thrd );
269        }
270        else if( action_code == Release_Schedule ) {
271                verify( !preemption_state.enabled );
272                unlock( *lock );
273                ScheduleThread( thrd );
274        }
275        else if( action_code == Release_Multi ) {
276                verify( !preemption_state.enabled );
277                for(int i = 0; i < lock_count; i++) {
278                        unlock( *locks[i] );
279                }
280        }
281        else if( action_code == Release_Multi_Schedule ) {
282                for(int i = 0; i < lock_count; i++) {
283                        unlock( *locks[i] );
284                }
285                for(int i = 0; i < thrd_count; i++) {
286                        ScheduleThread( thrds[i] );
287                }
288        }
289        else {
290                assert(action_code == No_Action);
291        }
292}
293
294// Handles spinning logic
295// TODO : find some strategy to put cores to sleep after some time
296void spin(processor * this, unsigned int * spin_count) {
297        (*spin_count)++;
298}
299
300// Context invoker for processors
301// This is the entry point for processors (kernel threads)
302// It effectively constructs a coroutine by stealing the pthread stack
303void * CtxInvokeProcessor(void * arg) {
304        processor * proc = (processor *) arg;
305        this_processor = proc;
306        this_coroutine = NULL;
307        this_thread = NULL;
308        preemption_state.enabled = false;
309        preemption_state.disable_count = 1;
310        // SKULLDUGGERY: We want to create a context for the processor coroutine
311        // which is needed for the 2-step context switch. However, there is no reason
312        // to waste the perfectly valid stack create by pthread.
313        current_stack_info_t info;
314        machine_context_t ctx;
315        info.context = &ctx;
316        processorCtx_t proc_cor_storage = { proc, &info };
317
318        __cfaabi_dbg_print_safe("Coroutine : created stack %p\n", proc_cor_storage.__cor.stack.base);
319
320        //Set global state
321        this_coroutine = &proc->runner->__cor;
322        this_thread = NULL;
323
324        //We now have a proper context from which to schedule threads
325        __cfaabi_dbg_print_safe("Kernel : core %p created (%p, %p)\n", proc, proc->runner, &ctx);
326
327        // SKULLDUGGERY: Since the coroutine doesn't have its own stack, we can't
328        // resume it to start it like it normally would, it will just context switch
329        // back to here. Instead directly call the main since we already are on the
330        // appropriate stack.
331        proc_cor_storage.__cor.state = Active;
332        main( proc_cor_storage );
333        proc_cor_storage.__cor.state = Halted;
334
335        // Main routine of the core returned, the core is now fully terminated
336        __cfaabi_dbg_print_safe("Kernel : core %p main ended (%p)\n", proc, proc->runner);
337
338        return NULL;
339}
340
341void start(processor * this) {
342        __cfaabi_dbg_print_safe("Kernel : Starting core %p\n", this);
343
344        pthread_create( &this->kernel_thread, NULL, CtxInvokeProcessor, (void*)this );
345
346        __cfaabi_dbg_print_safe("Kernel : core %p started\n", this);
347}
348
349void kernel_first_resume(processor * this) {
350        coroutine_desc * src = this_coroutine;
351        coroutine_desc * dst = get_coroutine(*this->runner);
352
353        verify( !preemption_state.enabled );
354
355        create_stack(&dst->stack, dst->stack.size);
356        CtxStart(this->runner, CtxInvokeCoroutine);
357
358        verify( !preemption_state.enabled );
359
360        dst->last = src;
361        dst->starter = dst->starter ? dst->starter : src;
362
363        // set state of current coroutine to inactive
364        src->state = src->state == Halted ? Halted : Inactive;
365
366        // set new coroutine that task is executing
367        this_coroutine = dst;
368
369        // SKULLDUGGERY normally interrupts are enable before leaving a coroutine ctxswitch.
370        // Therefore, when first creating a coroutine, interrupts are enable before calling the main.
371        // This is consistent with thread creation. However, when creating the main processor coroutine,
372        // we wan't interrupts to be disabled. Therefore, we double-disable interrupts here so they will
373        // stay disabled.
374        disable_interrupts();
375
376        // context switch to specified coroutine
377        assert( src->stack.context );
378        CtxSwitch( src->stack.context, dst->stack.context );
379        // when CtxSwitch returns we are back in the src coroutine
380
381        // set state of new coroutine to active
382        src->state = Active;
383
384        verify( !preemption_state.enabled );
385}
386
387//-----------------------------------------------------------------------------
388// Scheduler routines
389void ScheduleThread( thread_desc * thrd ) {
390        // if( !thrd ) return;
391        verify( thrd );
392        verify( thrd->self_cor.state != Halted );
393
394        verify( !preemption_state.enabled );
395
396        verifyf( thrd->next == NULL, "Expected null got %p", thrd->next );
397
398        with( *this_processor->cltr ) {
399                lock  ( ready_queue_lock __cfaabi_dbg_ctx2 );
400                append( ready_queue, thrd );
401                unlock( ready_queue_lock );
402        }
403
404        verify( !preemption_state.enabled );
405}
406
407thread_desc * nextThread(cluster * this) with( *this ) {
408        verify( !preemption_state.enabled );
409        lock( ready_queue_lock __cfaabi_dbg_ctx2 );
410        //TEMP hack to find a bug
411        if(this_processor != mainProcessor) {
412                if(ready_queue.head == mainThread) {
413                        unlock( ready_queue_lock );
414                        return NULL;
415                }
416        }
417
418        thread_desc * head = pop_head( ready_queue );
419        unlock( ready_queue_lock );
420        verify( !preemption_state.enabled );
421        return head;
422}
423
424void BlockInternal() {
425        disable_interrupts();
426        verify( !preemption_state.enabled );
427        returnToKernel();
428        verify( !preemption_state.enabled );
429        enable_interrupts( __cfaabi_dbg_ctx );
430}
431
432void BlockInternal( __spinlock_t * lock ) {
433        disable_interrupts();
434        this_processor->finish.action_code = Release;
435        this_processor->finish.lock        = lock;
436
437        verify( !preemption_state.enabled );
438        returnToKernel();
439        verify( !preemption_state.enabled );
440
441        enable_interrupts( __cfaabi_dbg_ctx );
442}
443
444void BlockInternal( thread_desc * thrd ) {
445        disable_interrupts();
446        this_processor->finish.action_code = Schedule;
447        this_processor->finish.thrd        = thrd;
448
449        verify( !preemption_state.enabled );
450        returnToKernel();
451        verify( !preemption_state.enabled );
452
453        enable_interrupts( __cfaabi_dbg_ctx );
454}
455
456void BlockInternal( __spinlock_t * lock, thread_desc * thrd ) {
457        assert(thrd);
458        disable_interrupts();
459        this_processor->finish.action_code = Release_Schedule;
460        this_processor->finish.lock        = lock;
461        this_processor->finish.thrd        = thrd;
462
463        verify( !preemption_state.enabled );
464        returnToKernel();
465        verify( !preemption_state.enabled );
466
467        enable_interrupts( __cfaabi_dbg_ctx );
468}
469
470void BlockInternal(__spinlock_t * locks [], unsigned short count) {
471        disable_interrupts();
472        this_processor->finish.action_code = Release_Multi;
473        this_processor->finish.locks       = locks;
474        this_processor->finish.lock_count  = count;
475
476        verify( !preemption_state.enabled );
477        returnToKernel();
478        verify( !preemption_state.enabled );
479
480        enable_interrupts( __cfaabi_dbg_ctx );
481}
482
483void BlockInternal(__spinlock_t * locks [], unsigned short lock_count, thread_desc * thrds [], unsigned short thrd_count) {
484        disable_interrupts();
485        this_processor->finish.action_code = Release_Multi_Schedule;
486        this_processor->finish.locks       = locks;
487        this_processor->finish.lock_count  = lock_count;
488        this_processor->finish.thrds       = thrds;
489        this_processor->finish.thrd_count  = thrd_count;
490
491        verify( !preemption_state.enabled );
492        returnToKernel();
493        verify( !preemption_state.enabled );
494
495        enable_interrupts( __cfaabi_dbg_ctx );
496}
497
498void LeaveThread(__spinlock_t * lock, thread_desc * thrd) {
499        verify( !preemption_state.enabled );
500        this_processor->finish.action_code = thrd ? Release_Schedule : Release;
501        this_processor->finish.lock        = lock;
502        this_processor->finish.thrd        = thrd;
503
504        returnToKernel();
505}
506
507//=============================================================================================
508// Kernel Setup logic
509//=============================================================================================
510//-----------------------------------------------------------------------------
511// Kernel boot procedures
512void kernel_startup(void) {
513        verify( !preemption_state.enabled );
514        __cfaabi_dbg_print_safe("Kernel : Starting\n");
515
516        // Start by initializing the main thread
517        // SKULLDUGGERY: the mainThread steals the process main thread
518        // which will then be scheduled by the mainProcessor normally
519        mainThread = (thread_desc *)&storage_mainThread;
520        current_stack_info_t info;
521        (*mainThread){ &info };
522
523        __cfaabi_dbg_print_safe("Kernel : Main thread ready\n");
524
525        // Initialize the main cluster
526        mainCluster = (cluster *)&storage_mainCluster;
527        (*mainCluster){};
528
529        __cfaabi_dbg_print_safe("Kernel : main cluster ready\n");
530
531        // Initialize the main processor and the main processor ctx
532        // (the coroutine that contains the processing control flow)
533        mainProcessor = (processor *)&storage_mainProcessor;
534        (*mainProcessor){ mainCluster, *(processorCtx_t *)&storage_mainProcessorCtx };
535
536        //initialize the global state variables
537        this_processor = mainProcessor;
538        this_thread = mainThread;
539        this_coroutine = &mainThread->self_cor;
540
541        // Enable preemption
542        kernel_start_preemption();
543
544        // Add the main thread to the ready queue
545        // once resume is called on mainProcessor->runner the mainThread needs to be scheduled like any normal thread
546        ScheduleThread(mainThread);
547
548        // SKULLDUGGERY: Force a context switch to the main processor to set the main thread's context to the current UNIX
549        // context. Hence, the main thread does not begin through CtxInvokeThread, like all other threads. The trick here is that
550        // mainThread is on the ready queue when this call is made.
551        kernel_first_resume( this_processor );
552
553
554
555        // THE SYSTEM IS NOW COMPLETELY RUNNING
556        __cfaabi_dbg_print_safe("Kernel : Started\n--------------------------------------------------\n\n");
557
558        verify( !preemption_state.enabled );
559        enable_interrupts( __cfaabi_dbg_ctx );
560        verify( preemption_state.enabled );
561}
562
563void kernel_shutdown(void) {
564        __cfaabi_dbg_print_safe("\n--------------------------------------------------\nKernel : Shutting down\n");
565
566        verify( preemption_state.enabled );
567        disable_interrupts();
568        verify( !preemption_state.enabled );
569
570        // SKULLDUGGERY: Notify the mainProcessor it needs to terminates.
571        // When its coroutine terminates, it return control to the mainThread
572        // which is currently here
573        mainProcessor->do_terminate = true;
574        returnToKernel();
575
576        // THE SYSTEM IS NOW COMPLETELY STOPPED
577
578        // Disable preemption
579        kernel_stop_preemption();
580
581        // Destroy the main processor and its context in reverse order of construction
582        // These were manually constructed so we need manually destroy them
583        ^(*mainProcessor->runner){};
584        ^(mainProcessor){};
585
586        // Final step, destroy the main thread since it is no longer needed
587        // Since we provided a stack to this taxk it will not destroy anything
588        ^(mainThread){};
589
590        __cfaabi_dbg_print_safe("Kernel : Shutdown complete\n");
591}
592
593//=============================================================================================
594// Unexpected Terminating logic
595//=============================================================================================
596
597
598static __spinlock_t kernel_abort_lock;
599static __spinlock_t kernel_debug_lock;
600static bool kernel_abort_called = false;
601
602void * kernel_abort    (void) __attribute__ ((__nothrow__)) {
603        // abort cannot be recursively entered by the same or different processors because all signal handlers return when
604        // the globalAbort flag is true.
605        lock( kernel_abort_lock __cfaabi_dbg_ctx2 );
606
607        // first task to abort ?
608        if ( !kernel_abort_called ) {                   // not first task to abort ?
609                kernel_abort_called = true;
610                unlock( kernel_abort_lock );
611        }
612        else {
613                unlock( kernel_abort_lock );
614
615                sigset_t mask;
616                sigemptyset( &mask );
617                sigaddset( &mask, SIGALRM );                    // block SIGALRM signals
618                sigaddset( &mask, SIGUSR1 );                    // block SIGUSR1 signals
619                sigsuspend( &mask );                            // block the processor to prevent further damage during abort
620                _exit( EXIT_FAILURE );                          // if processor unblocks before it is killed, terminate it
621        }
622
623        return this_thread;
624}
625
626void kernel_abort_msg( void * kernel_data, char * abort_text, int abort_text_size ) {
627        thread_desc * thrd = kernel_data;
628
629        int len = snprintf( abort_text, abort_text_size, "Error occurred while executing task %.256s (%p)", thrd->self_cor.name, thrd );
630        __cfaabi_dbg_bits_write( abort_text, len );
631
632        if ( thrd != this_coroutine ) {
633                len = snprintf( abort_text, abort_text_size, " in coroutine %.256s (%p).\n", this_coroutine->name, this_coroutine );
634                __cfaabi_dbg_bits_write( abort_text, len );
635        }
636        else {
637                __cfaabi_dbg_bits_write( ".\n", 2 );
638        }
639}
640
641int kernel_abort_lastframe( void ) __attribute__ ((__nothrow__)) {
642        return get_coroutine(this_thread) == get_coroutine(mainThread) ? 4 : 2;
643}
644
645extern "C" {
646        void __cfaabi_dbg_bits_acquire() {
647                lock( kernel_debug_lock __cfaabi_dbg_ctx2 );
648        }
649
650        void __cfaabi_dbg_bits_release() {
651                unlock( kernel_debug_lock );
652        }
653}
654
655//=============================================================================================
656// Kernel Utilities
657//=============================================================================================
658//-----------------------------------------------------------------------------
659// Locks
660void  ?{}( semaphore & this, int count = 1 ) {
661        (this.lock){};
662        this.count = count;
663        (this.waiting){};
664}
665void ^?{}(semaphore & this) {}
666
667void P(semaphore & this) with( this ){
668        lock( lock __cfaabi_dbg_ctx2 );
669        count -= 1;
670        if ( count < 0 ) {
671                // queue current task
672                append( waiting, (thread_desc *)this_thread );
673
674                // atomically release spin lock and block
675                BlockInternal( &lock );
676        }
677        else {
678            unlock( lock );
679        }
680}
681
682void V(semaphore & this) with( this ) {
683        thread_desc * thrd = NULL;
684        lock( lock __cfaabi_dbg_ctx2 );
685        count += 1;
686        if ( count <= 0 ) {
687                // remove task at head of waiting list
688                thrd = pop_head( waiting );
689        }
690
691        unlock( lock );
692
693        // make new owner
694        WakeThread( thrd );
695}
696
697//-----------------------------------------------------------------------------
698// Debug
699__cfaabi_dbg_debug_do(
700        struct {
701                thread_desc * tail;
702        } __cfaabi_dbg_thread_list = { NULL };
703
704        void __cfaabi_dbg_thread_register( thread_desc * thrd ) {
705                if( !__cfaabi_dbg_thread_list.tail ) {
706                        __cfaabi_dbg_thread_list.tail = thrd;
707                        return;
708                }
709                __cfaabi_dbg_thread_list.tail->dbg_next = thrd;
710                thrd->dbg_prev = __cfaabi_dbg_thread_list.tail;
711                __cfaabi_dbg_thread_list.tail = thrd;
712        }
713
714        void __cfaabi_dbg_thread_unregister( thread_desc * thrd ) {
715                thread_desc * prev = thrd->dbg_prev;
716                thread_desc * next = thrd->dbg_next;
717
718                if( next ) { next->dbg_prev = prev; }
719                else       {
720                        assert( __cfaabi_dbg_thread_list.tail == thrd );
721                        __cfaabi_dbg_thread_list.tail = prev;
722                }
723
724                if( prev ) { prev->dbg_next = next; }
725
726                thrd->dbg_prev = NULL;
727                thrd->dbg_next = NULL;
728        }
729)
730// Local Variables: //
731// mode: c //
732// tab-width: 4 //
733// End: //
Note: See TracBrowser for help on using the repository browser.