Ignore:
Timestamp:
Sep 16, 2020, 1:48:12 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:
2724b4e
Parents:
1c01c58
Message:

I/O operations now use futures.
io calls implementation are now generated at configure time.

Location:
libcfa/src/concurrency/io
Files:
1 added
1 edited

Legend:

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

    r1c01c58 rc402739f  
    104104        //-----------------------------------------------------------------------
    105105        // IO user data
    106         struct __io_user_data_t {
     106        struct io_future_t {
     107                future_t self;
    107108                __s32 result;
    108                 oneshot sem;
    109109        };
     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        }
    110122
    111123        //-----------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.