Ignore:
Timestamp:
Sep 21, 2020, 3:59:03 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
0e52f14
Parents:
0519e34
Message:

Fix io types to work without io_uring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/io/types.hfa

    r0519e34 r930e57e  
    1616#pragma once
    1717
     18extern "C" {
     19        #include <linux/types.h>
     20}
     21
     22#include "bits/locks.hfa"
     23
    1824#if defined(CFA_HAVE_LINUX_IO_URING_H)
    19         extern "C" {
    20                 #include <linux/types.h>
    21         }
    22 
    23       #include "bits/locks.hfa"
    24 
    2525        #define LEADER_LOCK
    2626        struct __leaderlock_t {
     
    101101        };
    102102
    103 
    104         //-----------------------------------------------------------------------
    105         // IO user data
    106         struct io_future_t {
    107                 future_t self;
    108                 __s32 result;
    109         };
    110 
    111         static inline {
    112                 bool fulfil( io_future_t & this, __s32 result ) {
    113                         this.result = result;
    114                         return fulfil(this.self);
    115                 }
    116 
    117                 // Wait for the future to be fulfilled
    118                 bool wait( io_future_t & this ) {
    119                         return wait(this.self);
    120                 }
    121         }
    122 
    123103        //-----------------------------------------------------------------------
    124104        // Misc
     
    155135        void __ioctx_prepare_block($io_ctx_thread & ctx, struct epoll_event & ev);
    156136#endif
     137
     138//-----------------------------------------------------------------------
     139// IO user data
     140struct io_future_t {
     141        future_t self;
     142        __s32 result;
     143};
     144
     145static inline {
     146        bool fulfil( io_future_t & this, __s32 result ) {
     147                this.result = result;
     148                return fulfil(this.self);
     149        }
     150
     151        // Wait for the future to be fulfilled
     152        bool wait( io_future_t & this ) {
     153                return wait(this.self);
     154        }
     155}
Note: See TracChangeset for help on using the changeset viewer.