Back to index

glibc  2.9
Functions
lockfile.c File Reference
#include <bits/libc-lock.h>
#include <stdio.h>
#include <pthread.h>
#include "internals.h"
#include "../libio/libioP.h"

Go to the source code of this file.

Functions

void __flockfile (FILE *stream)
 strong_alias (weak_alias(__flockfile, _IO_flockfile)
 strong_alias (weak_alias(__funlockfile, _IO_funlockfile)
 strong_alias (weak_alias(__ftrylockfile, _IO_ftrylockfile)
void __funlockfilelist (void)
void __fresetlockfiles (void)

Function Documentation

void __flockfile ( FILE stream)

Definition at line 27 of file lockfile.c.

{
  __pthread_mutex_lock (stream->_lock);
}
void __fresetlockfiles ( void  )

Definition at line 67 of file lockfile.c.

{
  _IO_ITER i;

  pthread_mutexattr_t attr;

  __pthread_mutexattr_init (&attr);
  __pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE_NP);

  for (i = _IO_iter_begin(); i != _IO_iter_end(); i = _IO_iter_next(i))
    __pthread_mutex_init (_IO_iter_file(i)->_lock, &attr);

  __pthread_mutexattr_destroy (&attr);

  _IO_list_resetlock();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void __funlockfilelist ( void  )

Definition at line 61 of file lockfile.c.

{
  _IO_list_unlock();
}

Here is the caller graph for this function:

strong_alias ( weak_alias __flockfile,
_IO_flockfile   
)

Definition at line 32 of file lockfile.c.

{
  __pthread_mutex_unlock (stream->_lock);
}

Here is the call graph for this function:

strong_alias ( weak_alias __funlockfile,
_IO_funlockfile   
)

Definition at line 42 of file lockfile.c.

{
  return __pthread_mutex_trylock (stream->_lock);
}

Here is the call graph for this function:

strong_alias ( weak_alias __ftrylockfile,
_IO_ftrylockfile   
)

Definition at line 51 of file lockfile.c.

{
  _IO_list_lock();
}