Ignore:
Timestamp:
2019-07-02T10:59:39Z (5 years ago)
Author:
Jaroslav Jindrak <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
09170ab8
Parents:
239d25b
Message:

cpp: add stub exception support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/__bits/thread/promise.hpp

    r239d25b r4d68584  
    3030#define LIBCPP_BITS_THREAD_PROMISE
    3131
     32#include <__bits/exception.hpp>
    3233#include <__bits/thread/future.hpp>
    3334#include <__bits/thread/shared_state.hpp>
     
    9495                }
    9596
    96                 void set_exception_at_thread_exit(exception_ptr)
    97                 {
    98                     // TODO: No exception handling, no-op at this time.
     97                void set_exception_at_thread_exit(exception_ptr ptr)
     98                {
     99                    assert(state_);
     100
     101                    state_->set_exception_ptr(ptr, false);
     102                    // TODO: Mark it as 'has_exception' when thread terminates.
    99103                }
    100104
     
    117121                    if (!state_->is_set())
    118122                    {
    119                         // TODO: Store future_error.
     123                        state_->set_exception(make_exception_ptr(
     124                            future_error{make_error_code(future_errc::broken_promise)}
     125                        ));
    120126                        state_->mark_set(true);
    121127                    }
Note: See TracChangeset for help on using the changeset viewer.