⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stdthread.h

📁 spines-ns
💻 H
字号:
/* Copyright (c) 2000, The Johns Hopkins University * All rights reserved. * * The contents of this file are subject to a license (the ``License'') * that is the exact equivalent of the BSD license as of July 23, 1999.  * You may not use this file except in compliance with the License. The * specific language governing the rights and limitations of the License * can be found in the file ``STDUTIL_LICENSE'' found in this  * distribution. * * Software distributed under the License is distributed on an AS IS  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  * * The Original Software is: *     The Stdutil Library *  * Contributors: *     Creator - John Lane Schultz (jschultz@cnds.jhu.edu) *     The Center for Networking and Distributed Systems *         (CNDS - http://www.cnds.jhu.edu) */ #ifndef stdthread_h_2000_03_14_12_28_17_jschultz_at_cnds_jhu_edu#define stdthread_h_2000_03_14_12_28_17_jschultz_at_cnds_jhu_edu/* stdmutex static initializer */#define STDMUTEX_STATIC_CONSTRUCT#include "stddefines.h"#include "stdthread_p.h"/* stdmutex: work similiar to pthread mutexes, but cannot be copied or moved */#define STDMUTEX_FAIL    -1#define STDMUTEX_BUSY    -2extern inline int stdmutex_construct(stdmutex *mut);extern inline int stdmutex_destruct(stdmutex *mut);extern inline int stdmutex_lock(stdmutex *mut);extern inline int stdmutex_trylock(stdmutex *mut);extern inline int stdmutex_unlock(stdmutex *mut);/* stdcond: work similiar to pthread conditions, but no static initializer */#define STDCOND_TIMEOUT   1#define STDCOND_FAIL    -10#define STDCOND_BUSY    -11extern inline int stdcond_construct(stdcond *cond);extern inline int stdcond_destruct(stdcond *cond);extern inline int stdcond_wait(stdcond *cond, stdmutex *mut);extern inline int stdcond_timedwait(stdcond *cond, stdmutex *mut, long ns);extern inline int stdcond_signal(stdcond *cond);extern inline int stdcond_broadcast(stdcond *cond);#endif

⌨️ 快捷键说明

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