Changeset 77e6fcb


Ignore:
Timestamp:
Feb 1, 2017, 2:55:06 PM (8 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:
de90452
Parents:
8761006c
Message:

Removed trailing semi-colon on thread/coroutine declaration macro

Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/examples/Bench.c

    r8761006c r77e6fcb  
    8787
    8888struct CoroutineDummy { coroutine c; };
    89 DECL_COROUTINE(CoroutineDummy)
     89DECL_COROUTINE(CoroutineDummy);
    9090void main(CoroutineDummy * this) {}
    9191
     
    122122};
    123123
    124 DECL_COROUTINE(CoroutineResume)
     124DECL_COROUTINE(CoroutineResume);
    125125
    126126void ?{}(CoroutineResume* this, int N) {
     
    151151
    152152struct ThreadDummy { thread t; };
    153 DECL_THREAD(ThreadDummy)
     153DECL_THREAD(ThreadDummy);
    154154void main(ThreadDummy * this) {}
    155155
     
    183183};
    184184
    185 DECL_THREAD(ContextSwitch)
     185DECL_THREAD(ContextSwitch);
    186186
    187187void main(ContextSwitch * this) {   
  • src/libcfa/concurrency/coroutines

    r8761006c r77e6fcb  
    3030};
    3131
    32 #define DECL_COROUTINE(X) static inline coroutine* get_coroutine(X* this) { return &this->c; } void main(X* this);
     32#define DECL_COROUTINE(X) static inline coroutine* get_coroutine(X* this) { return &this->c; } void main(X* this)
    3333
    3434//-----------------------------------------------------------------------------
     
    110110}
    111111
     112static inline void resume(coroutine * dst) {
     113        coroutine * src = this_coroutine();             // optimization
     114
     115      // not resuming self ?
     116        if ( src != dst ) {
     117                assertf( dst->notHalted ,
     118                        "Attempt by coroutine %.256s (%p) to resume terminated coroutine %.256s (%p).\n"
     119                        "Possible cause is terminated coroutine's main routine has already returned.",
     120                        src->name, src, dst->name, dst );
     121
     122            // set last resumer
     123                dst->last = src;
     124        } // if
     125
     126      // always done for performance testing
     127        CoroutineCtxSwitch( src, dst );
     128}
     129
    112130#endif //COROUTINES_H
    113131
  • src/libcfa/concurrency/kernel.c

    r8761006c r77e6fcb  
    4343};
    4444
    45 DECL_COROUTINE(processorCtx_t)
     45DECL_COROUTINE(processorCtx_t);
    4646
    4747#define KERNEL_STORAGE(T,X) static char X##_storage[sizeof(T)]
  • src/libcfa/concurrency/threads

    r8761006c r77e6fcb  
    3232};
    3333
    34 #define DECL_THREAD(X) thread* get_thread(X* this) { return &this->t; } void main(X* this);
     34#define DECL_THREAD(X) thread* get_thread(X* this) { return &this->t; } void main(X* this)
    3535
    3636forall( dtype T | is_thread(T) )
  • src/tests/thread.c

    r8761006c r77e6fcb  
    77struct Second { thread t; simple_lock* lock; };
    88
    9 DECL_THREAD(First)
    10 DECL_THREAD(Second)
     9DECL_THREAD(First);
     10DECL_THREAD(Second);
    1111
    1212void ?{}( First * this, simple_lock* lock ) { this->lock = lock; }
Note: See TracChangeset for help on using the changeset viewer.