Interrupt a function
-
Is there any way to interrupt a function once it is called if it is not part of your code? For example: DataTable.Load(IDataReader); I'd like to be able to simply stop the execution of the load function. I guess I could use an async call but I am doing this from a form, is it safe to do it ? Thanks
-
Is there any way to interrupt a function once it is called if it is not part of your code? For example: DataTable.Load(IDataReader); I'd like to be able to simply stop the execution of the load function. I guess I could use an async call but I am doing this from a form, is it safe to do it ? Thanks
~
Johnny~ wrote:Is there any way to interrupt a function once it is called if it is not part of your code?
Why, you trying to write a debugger or something?
~
Johnny~ wrote:I guess I could use an async call but I am doing this from a form
You could, this would be the best way.
~
Johnny~ wrote:is it safe to do it ?
If you know how.
-
Is there any way to interrupt a function once it is called if it is not part of your code? For example: DataTable.Load(IDataReader); I'd like to be able to simply stop the execution of the load function. I guess I could use an async call but I am doing this from a form, is it safe to do it ? Thanks
~
Johnny~ wrote:is it safe to do it ?
One problem with interrupting other threads/functions is that you wouldn't know if it holds any locks when you are interrupting - if it did, then anyone attempting to lock on the same object will deadlock.
Regards Senthil [MVP - Visual C#] _____________________________ My Blog | My Articles | My Flickr | WinMacro
-
~
Johnny~ wrote:is it safe to do it ?
One problem with interrupting other threads/functions is that you wouldn't know if it holds any locks when you are interrupting - if it did, then anyone attempting to lock on the same object will deadlock.
Regards Senthil [MVP - Visual C#] _____________________________ My Blog | My Articles | My Flickr | WinMacro