35/// Used to assist passing exceptions between threads.
36/**
37 Note that this class is not thread-safe - it presumes that access to it, although from different threads, will always be sequential. (i.e. not simultaneous.)
38 It also propagates any contained exception only once - to the calling thread. (Thus if it were truly multi-thread-safe it should propagate the exception to all calling threads.)
39 But then the whole paradigm of the execution context is that only one thread at a time should wait on the results from it.
40
41 \todo Make use of std::exception_ptr or similar to pass any thrown exception.
46 We only want one thread to throw the exception, despite the fact that many may be connected to it, see specification of throw_if_set().
47
48 Note that this implementation can use raw pointers and operate correctly on SMP architectures that support the MESI or MOESI architectures (and may work correctly with other implementations), without needing to use more complex operations. But we use allow the potential for the more complex operations here to support those more hairy architectures.