Back to index

glibc  2.9
jmp-unwind.c File Reference
#include <jmpbuf-unwind.h>
#include <hurd/userlink.h>
#include <hurd/signal.h>
#include <hurd/sigpreempt.h>
#include <assert.h>
#include <stdint.h>

Go to the source code of this file.


static uintptr_t demangle_ptr (uintptr_t x)
void _longjmp_unwind (jmp_buf env, int val)

Function Documentation

void _longjmp_unwind ( jmp_buf  env,
int  val 

Definition at line 46 of file jmp-unwind.c.

  struct hurd_sigstate *ss = _hurd_self_sigstate ();
  struct hurd_userlink *link;

  /* All access to SS->active_resources must take place inside a critical
     section where signal handlers cannot run.  */
  __spin_lock (&ss->lock);
  assert (! __spin_lock_locked (&ss->critical_section_lock));
  __spin_lock (&ss->critical_section_lock);

  /* Remove local signal preemptors being unwound past.  */
  while (ss->preemptors &&
        _JMPBUF_UNWINDS (env[0].__jmpbuf, ss->preemptors, demangle_ptr))
    ss->preemptors = ss->preemptors->next;

  __spin_unlock (&ss->lock);

  /* Iterate over the current thread's list of active resources.
     Process the head portion of the list whose links reside
     in stack frames being unwound by this jump.  */

  for (link = ss->active_resources;
       link && _JMPBUF_UNWINDS (env[0].__jmpbuf, link, demangle_ptr);
       link = link->
    /* Remove this link from the resource's users list,
       since the frame using the resource is being unwound.
       This call returns nonzero if that was the last user.  */
    if (_hurd_userlink_unlink (link))
      /* One of the frames being unwound by the longjmp was the last user
        of its resource.  Call the cleanup function to deallocate it.  */
      (*link->cleanup) (link->cleanup_data, env, val);

  _hurd_critical_section_unlock (ss);

Here is the call graph for this function:

Here is the caller graph for this function:

static uintptr_t demangle_ptr ( uintptr_t  x) [inline, static]

Definition at line 33 of file jmp-unwind.c.

# endif
  return x;

Here is the caller graph for this function: