/*****************************************************************************
 *                                  _   _ ____  _     
 *  Project                     ___| | | |  _ \| |    
 *                             / __| | | | |_) | |    
 *                            | (__| |_| |  _ <| |___ 
 *                             \___|\___/|_| \_\_____|
 *
 * Copyright (C) 2001, Daniel Stenberg, <daniel@haxx.se>, et al
 *
 * In order to be useful for every potential user, curl and libcurl are
 * dual-licensed under the MPL and the MIT/X-derivate licenses.
 *
 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
 * copies of the Software, and permit persons to whom the Software is
 * furnished to do so, under the terms of the MPL or the MIT/X-derivate
 * licenses. You may pick one of these licenses.
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 * KIND, either express or implied.
 *
 * $Id: hash.c,v 1.2 2002/01/07 20:52:32 bumblebury Exp $
 *****************************************************************************/

#include "setup.h"
#include "thread.h"

#ifdef MALLOCDEBUG
/* this must be the last include file */
#include "memdebug.h"
#endif

void Curl_mutex_initialize(struct Curl_mutex *m)
{
  if (m->init) {
    m->init(m->userData);
  }
}

int Curl_mutex_lock(struct Curl_mutex *m)
{
  if (m->lock) {
    return m->lock(m->userData);
  }
  else {
    return 1;
  }
}

int Curl_mutex_unlock(struct Curl_mutex *m)
{
  if (m->unlock) {
    return m->unlock(m->userData);
  }
  else {
    return 1;
  }
}

void Curl_mutex_destroy(struct Curl_mutex *m)
{
  if (m->dtor) {
    m->dtor(m->userData);
  }
}

/*
 * local variables:
 * eval: (load-file "../curl-mode.el")
 * end:
 * vim600: fdm=marker
 * vim: et sw=2 ts=2 sts=2 tw=78
 */

