Commit graph

13 commits

Author SHA1 Message Date
Peter Conrad
7506aaefe7 Moved retain/release to task_base 2019-06-06 14:39:14 +02:00
Daniel Larimer
6495004302 move potential yields outside of catch 2015-10-09 17:08:03 -04:00
Eric Frias
307252e23a Call fc:🧵:quit() on thread destruction, and remove code that explicitly terminates threads from the destructors of the objects that own those threads.
Fix fc::thread to set the thread name in the Debugger when the name is set after thread construction.
When terminating a thread, cancel any tasks that have been schedule()d or async()ed but have not yet started executing.
When canceling a task blocked on a fc::mutex, notify the thread to reschedule the task to allow it to clean up the mutex's block list.
Fix a bug in managing the recursive lock count when tasks block on a fc::mutex
Reorder the code that manages the hard links for log files to avoid an exception generated by unlinking a locked file on Windows.
2014-10-21 10:25:28 -04:00
Eric Frias
130da3623e Allow fibers to be canceled while they're sleeping or blocked on promises 2014-09-08 10:41:59 -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
8841f5e271 Import thread/task_specific variables 2014-08-27 12:20:19 -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
Daniel Larimer
ffa617183e if a task is canceled before it is run, then it will throw a canceled exception 2014-06-28 21:08:15 -04:00
Eric Frias
fdbaf88e5e Provide a way to intercept Win32 structured exceptions in async tasks
Something about the stacks created by boost::context prevents global structured exception handlers
from being called.  This allows the user to register a handler which will be called when there
is an unhandled structured exception in async task.
2014-03-08 18:48:19 -05:00
vogel76
08ab455dff [BW]: [Fix] fc::task_base class member initialization. 2014-01-06 23:58:42 +01:00
Daniel Larimer
59a121d64b Updating FC with changes from phoenix-int 2013-06-05 15:19:00 -04:00