Ignore:
Timestamp:
Sep 21, 2020, 11:37:28 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
7a80113
Parents:
31a6f38 (diff), ace2e92 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc into master

File:
1 edited

Legend:

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

    r31a6f38 r08f3ad3  
    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_user_data_t {
    107                 __s32 result;
    108                 oneshot sem;
    109         };
    110 
    111103        //-----------------------------------------------------------------------
    112104        // Misc
     
    143135        void __ioctx_prepare_block($io_ctx_thread & ctx, struct epoll_event & ev);
    144136#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.