rwlock.h

来自「MANTIS是由科罗拉多大学开发的传感器网络嵌入式操作系统。 这是mantis」· C头文件 代码 · 共 43 行

H
43
字号
//  This file is part of MANTIS OS, Operating System//  See http://mantis.cs.colorado.edu/////  Copyright (C) 2003,2004,2005 University of Colorado, Boulder////  This program is free software; you can redistribute it and/or//  modify it under the terms of the mos license (see file LICENSE)/** @file mos/kernel/linux/include/rwlock.h * @brief Basic read-write locking support. * * @author Lane Phillips * @date Created: 02/26/2005 */#ifndef RWLOCK_H_#define RWLOCK_H_#include "mos.h"#include <pthread.h>/** @brief Read-write lock is locked */#define RWLOCK_LOCKED EBUSY/** @brief Read-write lock is unlocked */#define RWLOCK_OK 0typedef pthread_rwlock_t mos_rwlock_t;#define rwlock_init(lock)		pthread_rwlock_init(lock,NULL)#define rwlock_rdlock(lock)		pthread_rwlock_rdlock(lock)#define rwlock_tryrdlock(lock)	pthread_rwlock_tryrdlock(lock)#define rwlock_wrlock(lock)		pthread_rwlock_wrlock(lock)#define rwlock_trywrlock(lock)	pthread_rwlock_trywrlock(lock)#define rwlock_unlock(lock)		pthread_rwlock_unlock(lock)// Not implemented/*void rwlock_timedrdlock(lock,            const struct timespec *restrict);void rwlock_timedwrlock(lock,            const struct timespec *restrict);*/#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?