Ignore:
File:
1 edited

Legend:

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

    r8118303 r0157ca7  
     1//                              -*- Mode: C -*-
     2//
     3// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
     4//
     5// The contents of this file are covered under the licence agreement in the
     6// file "LICENCE" distributed with Cforall.
     7//
     8// invoke.h --
     9//
     10// Author           : Thierry Delisle
     11// Created On       : Tue Jan 17 12:27:26 2016
     12// Last Modified By : Thierry Delisle
     13// Last Modified On : --
     14// Update Count     : 0
     15//
     16
    117#include <stdbool.h>
    218#include <stdint.h>
     
    1127
    1228      #define unlikely(x)    __builtin_expect(!!(x), 0)
     29      #define thread_local _Thread_local
     30      #define SCHEDULER_CAPACITY 10
     31
     32      struct simple_thread_list {
     33            struct thread * head;
     34            struct thread ** tail;
     35      };
     36
     37      #ifdef __CFORALL__
     38      extern "Cforall" {
     39            void ?{}( struct simple_thread_list * );
     40            void append( struct simple_thread_list *, struct thread * );
     41            struct thread * pop_head( struct simple_thread_list * );
     42      }
     43      #endif
    1344
    1445      struct coStack_t {
     
    3566      };
    3667
    37       struct thread_h {
     68      struct simple_lock {
     69        struct simple_thread_list blocked;
     70      };
     71
     72      struct thread {
    3873            struct coroutine c;
     74            struct simple_lock lock;
     75            struct thread * next;
    3976      };
    4077
     
    5289      // assembler routines that performs the context switch
    5390      extern void CtxInvokeStub( void );
    54       void CtxSwitch( void *from, void *to ) asm ("CtxSwitch");
     91      void CtxSwitch( void * from, void * to ) asm ("CtxSwitch");
     92      void CtxGet( void * this ) asm ("CtxGet");
    5593
    5694#endif //_INVOKE_PRIVATE_H_
Note: See TracChangeset for help on using the changeset viewer.