Back to index

glibc  2.9
Classes | Defines | Functions
userlink.h File Reference
#include <features.h>
#include <stddef.h>
#include <hurd/signal.h>
#include <setjmp.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hurd_userlink

Defines

#define __need_NULL
#define _HURD_USERLINK_H_EXTERN_INLINE   __extern_inline

Functions

_HURD_USERLINK_H_EXTERN_INLINE void _hurd_userlink_link (struct hurd_userlink **chainp, struct hurd_userlink *link)
_HURD_USERLINK_H_EXTERN_INLINE int _hurd_userlink_unlink (struct hurd_userlink *link)
_HURD_USERLINK_H_EXTERN_INLINE int _hurd_userlink_clear (struct hurd_userlink **chainp)

Class Documentation

struct hurd_userlink.resource

Definition at line 61 of file userlink.h.

Class Members
struct hurd_userlink * next
struct hurd_userlink ** prevp
struct hurd_userlink.thread

Definition at line 61 of file userlink.h.

Class Members
struct hurd_userlink * next
struct hurd_userlink ** prevp

Define Documentation

#define __need_NULL

Definition at line 25 of file userlink.h.

Definition at line 74 of file userlink.h.


Function Documentation

Definition at line 136 of file userlink.h.

{
  if (*chainp == NULL)
    return 1;

  /* Detach the chain of current users from the cell.  The last user to
     remove his link from that chain will deallocate the old resource.  */
  (*chainp)->resource.prevp = NULL;
  *chainp = NULL;
  return 0;
}

Here is the caller graph for this function:

_HURD_USERLINK_H_EXTERN_INLINE void _hurd_userlink_link ( struct hurd_userlink **  chainp,
struct hurd_userlink link 
)

Definition at line 81 of file userlink.h.

{
  struct hurd_userlink **thread_chainp;

  link->resource.next = *chainp;
  if (link->resource.next)
    link->resource.next->resource.prevp = &link->resource.next;
  link->resource.prevp = chainp;
  *chainp = link;

  /* Also chain it on the current thread's list of active resources.  */
  thread_chainp = &_hurd_self_sigstate ()->active_resources;
  link->thread.next = *thread_chainp;
  if (link->thread.next)
    link->thread.next->thread.prevp = &link->thread.next;
  link->thread.prevp = thread_chainp;
  *thread_chainp = link;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 106 of file userlink.h.

{
  /* We should deallocate the resource used if this chain has been detached
     from the cell (and thus has a nil `prevp'), and there is no next link
     representing another user reference to the same resource. */
  int dealloc = ! link->resource.next && ! link->resource.prevp;

  /* Remove our link from the chain of current users.  */
  if (link->resource.prevp)
    *link->resource.prevp = link->resource.next;
  if (link->resource.next)
    link->resource.next->resource.prevp = link->resource.prevp;

  /* Remove our link from the chain of currently active resources
     for this thread.  */
  *link->thread.prevp = link->thread.next;
  if (link->thread.next)
    link->thread.next->thread.prevp = link->thread.prevp;

  return dealloc;
}

Here is the caller graph for this function: