media/webrtc/signaling/src/sipcc/cpr/include/cpr_locks.h
author Phil Ringnalda <philringnalda@gmail.com>
Mon, 08 Dec 2014 20:53:07 -0800
changeset 218811 960303b07c909e69db87467d0b499351d65c82af
permissions -rw-r--r--
Backed out 10 changesets (bug 1091242) for Android/b2g non-unified build bustage CLOSED TREE Backed out changeset 7f72b55c5de7 (bug 1091242) Backed out changeset f1501aa24397 (bug 1091242) Backed out changeset 7fde5994aee5 (bug 1091242) Backed out changeset 59b415714087 (bug 1091242) Backed out changeset dadb65fedc08 (bug 1091242) Backed out changeset 21be81424e4e (bug 1091242) Backed out changeset 498fb1dafba5 (bug 1091242) Backed out changeset 8d0653eb85ab (bug 1091242) Backed out changeset c82d484e135a (bug 1091242) Backed out changeset 3e0c8932f1b1 (bug 1091242)

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef _CPR_LOCKS_H_
#define _CPR_LOCKS_H_

#include "cpr_types.h"
#include "cpr_time.h"

__BEGIN_DECLS

/**
 * Define handle for mutexes
 */
typedef void* cprMutex_t;

/**
 * Mutex information needed to hide OS differences in implementation.
 * To use mutexes, the application code may pass in a name to the
 * create function for mutexes. CPR does not use this field, it is
 * solely for the convience of the application and to aid in debugging.
 * Upon an application calling the init routine, CPR will malloc the
 * memory for a mutex, set the handlePtr or handleInt as appropriate
 * and return a pointer to the mutex structure.
 */
typedef struct {
    const char*  name;
    uint16_t lockId;
    union {
      void* handlePtr;
      uint32_t handleInt;
    } u;
} cpr_mutex_t;


/**
 * Define handle for conditions
 */
typedef void* cprSignal_t;

/**
 * Condition information needed to hide OS differences in implementation.
 * To use conditions, the application code may pass in a name to the
 * create function for mutexes. CPR does not use this field, it is
 * solely for the convience of the application and to aid in debugging.
 * Upon an application calling the init routine, CPR will malloc the
 * memory for a condition, set the handlePtr or handleInt as appropriate
 * and return a pointer to the condition structure.
 */
typedef struct {
    const char *name;
    uint16_t lockId;
    union {
      void *handlePtr;
      uint32_t handleInt;
    } u;
} cpr_signal_t;


__END_DECLS

#endif