/*  -
   Copyright (C) 2006 Weongyo Jeong (weongyo@gmail.com)

This file is part of ROVM.

ROVM is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.

ROVM is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING.  If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.  */

/*
  이 파일에는 사용 중인 locking 메카니즘에 대한 wrapper 들로 구성되어 있습니다.

  !노트! 매크로를 이용하지 않는 이유는 디버깅을 위해서 입니다.
 */

/**
   Lock 을 시도한다.

   @param m	Thread Mutex 포인터.
 */
int
proc_mutex_lock (m)
     proc_mutex_t *m;
{
  return apr_proc_mutex_lock (m);
}

/**
   TryLock 을 시도한다.

   @param m	Thread Mutex 포인터.
 */
int
proc_mutex_trylock (m)
     proc_mutex_t *m;
{
  return apr_proc_mutex_trylock (m);
}

/**
   Unlock 을 시도한다.

   @param m	Thread Mutex 포인터.
 */
int
proc_mutex_unlock (m)
     proc_mutex_t *m;
{
  return apr_proc_mutex_unlock (m);
}

/**
   Thread Mutex 를 생성한다.  이 함수는 Memory Pool 을 이용한다.

   @param m	생성될 Mutex 포인터
   @param flags	옵션
   @param p	Memory pool 포인터
 */
int
proc_mutex_create (mutex, fname, mech, pool)
     proc_mutex_t **mutex;
     const char *fname;
     proc_lockmech_e mech;
     mpool_t *pool;
{
  return apr_proc_mutex_create (mutex, fname, mech, pool)
}

/**
   생성된 thread mutex 를 제거한다.

   @param m	제거할 thread mutex 포인터
 */
int
proc_mutex_destroy (m)
     proc_mutex_t *m;
{
  return apr_proc_mutex_destroy (m);
}
