15115240jeff/*
25115240jeff * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.
35115240jeff * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
45115240jeff * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
55115240jeff *
65115240jeff * This software is available to you under a choice of one of two
75115240jeff * licenses.  You may choose to be licensed under the terms of the GNU
85115240jeff * General Public License (GPL) Version 2, available from the file
95115240jeff * COPYING in the main directory of this source tree, or the
105115240jeff * OpenIB.org BSD license below:
115115240jeff *
125115240jeff *     Redistribution and use in source and binary forms, with or
135115240jeff *     without modification, are permitted provided that the following
145115240jeff *     conditions are met:
155115240jeff *
165115240jeff *      - Redistributions of source code must retain the above
175115240jeff *        copyright notice, this list of conditions and the following
185115240jeff *        disclaimer.
195115240jeff *
205115240jeff *      - Redistributions in binary form must reproduce the above
215115240jeff *        copyright notice, this list of conditions and the following
225115240jeff *        disclaimer in the documentation and/or other materials
235115240jeff *        provided with the distribution.
245115240jeff *
255115240jeff * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
265115240jeff * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
275115240jeff * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
285115240jeff * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
295115240jeff * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
305115240jeff * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
315115240jeff * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
325115240jeff * SOFTWARE.
335115240jeff *
345115240jeff */
355115240jeff
365115240jeff/*
375115240jeff * Abstract:
385115240jeff *	Implementation of spin lock object.
395115240jeff */
405115240jeff
415115240jeff#ifndef _CL_SPINLOCK_OSD_H_
425115240jeff#define _CL_SPINLOCK_OSD_H_
435115240jeff
445115240jeff#ifdef __cplusplus
455115240jeff#  define BEGIN_C_DECLS extern "C" {
465115240jeff#  define END_C_DECLS   }
475115240jeff#else				/* !__cplusplus */
485115240jeff#  define BEGIN_C_DECLS
495115240jeff#  define END_C_DECLS
505115240jeff#endif				/* __cplusplus */
515115240jeff
525115240jeffBEGIN_C_DECLS
535115240jeff#include <complib/cl_types.h>
545115240jeff#include <pthread.h>		/* usr/include/ */
555115240jefftypedef struct _cl_spinlock_t {
565115240jeff	pthread_mutex_t mutex;
575115240jeff	cl_state_t state;
585115240jeff} cl_spinlock_t;
595115240jeff
605115240jeffEND_C_DECLS
615115240jeff#endif				/* _CL_SPINLOCK_OSD_H_ */
62