Commit graph

20 commits

Author SHA1 Message Date
Peter Conrad
0aac8a4afc Replaced fc::forward with std::forward 2019-06-06 14:41:47 +02:00
Peter Conrad
7506aaefe7 Moved retain/release to task_base 2019-06-06 14:39:14 +02:00
Peter Conrad
19bbc4080e Added retain where applicable 2019-06-06 14:39:14 +02:00
Peter Conrad
7cf371736b Intermediate 2019-06-06 14:39:14 +02:00
Peter Conrad
579914c84d Removed unused stuff 2019-04-04 17:59:51 +02:00
Peter Conrad
9954a3775c Added constructor for auto-fulfillment 2018-10-03 21:08:42 +02: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
dnotestein
7cc69f3bb7 Set canceled flag in task's context object so that we cancel out of active tasks when they try to resume. Wrap a try-catch block around tcp and udp resolve requests to convert any non-fc exceptions to fc exceptions. Minor change to clarify design intent that request_time_task should always be running in _ntp_thread. 2014-08-01 11:31:36 -04:00
Eric Frias
d847f6469a Allow us to require assigning descriptions to all async tasks to aid in debugging 2014-07-27 17:37:21 -04:00
Eric Frias
24ba357b0d Make future's cancel_and_wait automatically swallow the canceled_exception since it is expected. 2014-07-26 14:51:48 -04:00
Daniel Larimer
eed62c8338 sockets now wait for any pending write or read operations to finish before destructing 2014-07-17 17:03:25 -04:00
Daniel Larimer
c33acad0ab fix udt sockets, actually enable non blocking operation 2014-06-29 01:38:46 -04:00
dnotestein
d1d365beaf further attempt at fixing Linux compile error 2013-12-13 09:13:08 -05:00
dnotestein
2d0bdb8e7a attempt to fix Linux compile error, needs to be verified on a Linux build machine 2013-12-12 22:18:09 -05:00
dnotestein
8e47816c4e Fix for problem reported with Boost 1.55 (memory_order_consume removed?). Also added move constructors for future, this second change probably needs review. 2013-12-12 09:19:15 -05:00
Daniel Larimer
9066e46b1b fix potential crashes by checking nullptr 2013-09-01 19:45:15 -04:00
Daniel Larimer
7ff92d3746 added ability to query cancel flag from future 2013-08-06 12:45:49 -04:00
Daniel Larimer
59a121d64b Updating FC with changes from phoenix-int 2013-06-05 15:19:00 -04:00
Renamed from include/fc/future.hpp (Browse further)