Commit graph

11 commits

Author SHA1 Message Date
Peter Conrad
7506aaefe7 Moved retain/release to task_base 2019-06-06 14:39:14 +02:00
Peter Conrad
7cf371736b Intermediate 2019-06-06 14:39:14 +02:00
theoreticalbts
83b4de067a future.cpp: Fix use-after-free bug cryptonomex/graphene#597 2016-02-25 03:04:45 -05:00
Daniel Larimer
6495004302 move potential yields outside of catch 2015-10-09 17:08:03 -04:00
dnotestein
10fdbcf5b3 Dequeue a thread from a blocking promise's notify list when the all the thread's tasks that are waiting on that promise are canceled. This prevents a crash when the promise is fulfilled after the thread is destroyed.
Re-organize read-loop execution to avoid crashes in read_loop on Win32 when ntp object destructs. Call quit on ntp_thread when ntp object destructs to free up thread (eventually we need to make fc::threads call quit in their destructor, but more work is required to make that work properly).
~fc::udp_socket now closes socket on destruction (consider doing this for tcp sockets as well).
2014-09-08 15:31:13 -04:00
Eric Frias
3222dc7c0b When reusing a context, re-initialize most of its fields. This fixes at least two errors:
- we were canceling tasks that hadn't been canceled, because the canceled flag was left set to true and the next task assigned to the context then became canceled as soon as it yielded
 - we were resumeing blocked tasks before they should have resumed, because their blocking_promises list wasn't cleared and they were unblocking because the erroneous promises were fulfilled
As a debugging aid, we also record the cancellation reason whenever a task is canceled, and include that in the canceled_exception (this is only enabled in debug builds)
2014-08-28 15:43:26 -04:00
Eric Frias
ac385d1f6b Allow the user to supply a reason string when canceling a task (useful for debugging) 2014-08-27 14:07:44 -04:00
Eric Frias
d188b138d6 Allow fc::canceled_exception to pass through places where we were catching and ignoring all fc::exceptions 2014-08-25 18:43:12 -04:00
Nathan Hourt
9e75d47ba3 Fix to an issue causing a thread to exit if any fiber therein self-cancels 2014-08-21 14:36:29 -04:00
Eric Frias
c63e598497 Fix a race that occurred when notifying a thread that was blocked on a
promise to wake up, but that thread simultaneously awoke for another
reason (probably a timeout)
2014-04-14 16:27:08 -04:00
Daniel Larimer
59a121d64b Updating FC with changes from phoenix-int 2013-06-05 15:19:00 -04:00
Renamed from src/future.cpp (Browse further)