📄 rwlock.h
字号:
// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -