Ignore:
Timestamp:
Sep 30, 2020, 4:44:22 PM (16 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
4e39f51
Parents:
d035cf7
Message:

Working towards allowing different thread frameworks to be picked from the command line

File:
1 moved

Legend:

Unmodified
Added
Removed
  • doc/theses/thierry_delisle_PhD/code/readQ_example/thrdlib/fibre.cpp

    rd035cf7 r29185fc  
    1 #pragma once
    2 
    31#include <cassert>
    42#include <libfibre/cfibre.h>
    53
    6 #if defined(__cforall) || defined(__cpluplus)
     4typedef cfibre_t thread_t;
     5static_assert(sizeof(thread_t) == sizeof(void*), "thread_t musst be of same size as void*");
     6
     7void * fibre_runner(void * arg) {
     8        auto the_main = (void (*)( thread_t ))arg;
     9        the_main( cfibre_self() );
     10        return nullptr;
     11}
     12
    713extern "C" {
    8 #endif
    9         //--------------------
    10         // Basic types
    11         typedef cfibre_t thread_t;
    12 
    13         void * fibre_runner(void * arg) {
    14                 auto the_main = (void (*)( thread_t ))arg;
    15                 the_main( cfibre_self() );
    16                 return nullptr;
    17         }
    18 
    1914        //--------------------
    2015        // Basic thread support
     
    5146
    5247        }
    53 
    54 
    55 #if defined(__cforall) || defined(__cpluplus)
    5648}
    57 #endif
Note: See TracChangeset for help on using the changeset viewer.