Ignore:
Timestamp:
Mar 17, 2017, 11:34:15 AM (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:
b32ada31
Parents:
9f1695b
Message:

Some clean-up of runtime code

File:
1 edited

Legend:

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

    r9f1695b r17af7d1  
    2828      #define unlikely(x)    __builtin_expect(!!(x), 0)
    2929      #define thread_local _Thread_local
    30       #define SCHEDULER_CAPACITY 10
    3130
    3231      struct spinlock {
     
    6059
    6160      struct coStack_t {
    62             unsigned int size;                // size of stack
    63             void *storage;                            // pointer to stack
    64             void *limit;                              // stack grows towards stack limit
    65             void *base;                               // base of stack
    66             void *context;                            // address of cfa_context_t
    67             void *top;                                // address of top of storage
    68             bool userStack;     
     61            unsigned int size;                  // size of stack
     62            void *storage;                      // pointer to stack
     63            void *limit;                        // stack grows towards stack limit
     64            void *base;                         // base of stack
     65            void *context;                      // address of cfa_context_t
     66            void *top;                          // address of top of storage
     67            bool userStack;                     // whether or not the user allocated the stack
    6968      };
    7069
     
    7271
    7372      struct coroutine_desc {
    74             struct coStack_t stack;
    75             const char *name;                         // textual name for coroutine/task, initialized by uC++ generated code
    76             int errno_;                               // copy of global UNIX variable errno
    77             enum coroutine_state state;       // current execution status for coroutine
    78             struct coroutine_desc *starter;           // first coroutine to resume this one
    79             struct coroutine_desc *last;                      // last coroutine to resume this one
     73            struct coStack_t stack;             // stack information of the coroutine
     74            const char *name;                   // textual name for coroutine/task, initialized by uC++ generated code
     75            int errno_;                         // copy of global UNIX variable errno
     76            enum coroutine_state state;         // current execution status for coroutine
     77            struct coroutine_desc *starter;     // first coroutine to resume this one
     78            struct coroutine_desc *last;              // last coroutine to resume this one
    8079      };
    8180
    8281      struct thread_desc {
    83             struct coroutine_desc c;                 // coroutine body used to store context
     82            struct coroutine_desc cor;            // coroutine body used to store context
    8483            struct signal_once terminated;      // indicate if execuation state is not halted
    85             struct thread_desc * next;               // instrusive link field for threads
     84            struct thread_desc * next;          // instrusive link field for threads
    8685      };
    8786
Note: See TracChangeset for help on using the changeset viewer.