function in C/C++ that never returns due to some reason

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Harsha H R
    New Member
    • Apr 2010
    • 1

    function in C/C++ that never returns due to some reason

    Can somebody tell me how to handle a scenario where the called function never returns due to some reason ?

    (The application should convey the end user that something has gone wrong and suggest a corrective action)
  • newb16
    Contributor
    • Jul 2008
    • 687

    #2
    Start it in a new thread, wait with timeout, kill the thread if the timeout expired but the thread is still running. That is in the case when you don't need to take care of event processing loop and not lock the user interface while the function is processing.

    Comment

    Working...