Ignore:
Timestamp:
Jan 17, 2017, 5:13:47 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:
c49bf54
Parents:
7350ff97
Message:

First prototype of cfa threads running (1 thread on 1 processor)

File:
1 edited

Legend:

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

    r7350ff97 r8118303  
    2020      void *this
    2121) {
    22       LIB_DEBUG_PRINTF("Invoke : Received %p (main %p, get_c %p)\n", this, main, get_coroutine);
     22      LIB_DEBUG_PRINTF("Invoke Coroutine : Received %p (main %p, get_c %p)\n", this, main, get_coroutine);
    2323
    2424      struct coroutine* cor = get_coroutine( this );
     
    3131
    3232      main( this );
     33
     34      //Final suspend, should never return
     35      __suspend_no_inline__F___1();
     36      assertf(false, "Resumed dead coroutine");
     37}
     38
     39void CtxInvokeThread(
     40      void (*main)(void *),
     41      struct thread_h *(*get_thread)(void *),
     42      void *this
     43) {
     44      LIB_DEBUG_PRINTF("Invoke Thread : Received %p (main %p, get_t %p)\n", this, main, get_thread);
     45
     46      __suspend_no_inline__F___1();
     47
     48      struct coroutine* cor = &get_thread( this )->c;
     49      cor->state = Active;
     50
     51      LIB_DEBUG_PRINTF("Invoke Thread : invoking main %p (args %p)\n", main, this);
     52      main( this );
     53
     54      //Final suspend, should never return
     55      __suspend_no_inline__F___1();
     56      assertf(false, "Resumed dead thread");
    3357}
    3458
     
    4064      void (*invoke)(void *)
    4165) {
    42       LIB_DEBUG_PRINTF("StartCoroutine : Passing in %p (main %p, get_c %p) to %p\n", this, main, get_coroutine, invoke);
     66      LIB_DEBUG_PRINTF("StartCoroutine : Passing in %p (main %p) to invoke (%p) from start (%p)\n", this, main, invoke, CtxStart);
    4367
    4468      struct coStack_t* stack = &get_coroutine( this )->stack;
Note: See TracChangeset for help on using the changeset viewer.