Re: Clear Stack



To unwind the stack, just raise an exception that's handled by a procedure
near the root of your stack. Reserve a dedicated error code for this
purpose, e.g.

Public Const ERR_UNWIND As Long = vbObjectError OR 1000

When necessary, raise this using something like:

Err.Raise ERR_UNWIND, TypeName(Me), "Unwinding stack"

In all your local error handlers, test for this explicit error code. If
that's the one then re-throw the error, else handle it as per normal, e.g.

LocalErrHandler:
If Err.Number = ERR_UNWIND Then
' Re-raise the error for someone else to handle
Err.Raise Err.Number, Err.Source, Err.Description, Err.HelpFile,
Err.HelpContext
Else
...handle the error as per normal...
End If

That reserved error code will eventually find its way to your root
procedure, at which point your stack will have been reset as requested

Tony Proctor

<theycallmebill@xxxxxxxxx> wrote in message
news:1129623691.318589.155340@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi all,
>
> Is there a way to clear the event queue and the stack?
>
> I have a communication program where I am several sub routines deep and
> in the event of an error on the other end, I need to keep the program
> from returning to all the subs. I could write a ton of code to do this,
> but I really would like to simply clear the queue.
>
> Bill
>


.



Relevant Pages

  • using -ftracer stops buildworld at shutdown.c
    ... When the C runtime executes a longjmp, the flow of control passes back ... In the process, the stack (which ... prevented from being optimized by declaring them as volatile. ... *** Error code 1 ...
    (freebsd-hackers)
  • Re: integer pthread_t vs. DCE threads
    ... that the stack is difficult to impossible to sensibly virtualize and ... the library needs to put down ... This is one of the problems with globals. ... replaced with a meaningless error code. ...
    (comp.programming.threads)
  • Re: Updated procstat(1)
    ... *** Error code 1 ... -stack_save(struct stack *st) ... +static void ...
    (freebsd-hackers)
  • Re: LAM/MPI MPICH-2 Compatibility
    ... Here is the error code that I have obtained: ... which says that, for example, the first "process is dead" message ... consistent with the messages about call stack, ...
    (comp.parallel.mpi)
  • Re: advanced programming unix environment
    ... I would appreciate if somebody else running freebsd 7.0 could download source and see if it makes fine on their installation. ... *** Error code 1 ... be unable to log in as root in any way, ... After the initial install I was able to log ...
    (freebsd-questions)