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

📄 sfmutex.c

📁 su 的源代码库
💻 C
字号:
/* Copyright (c) Colorado School of Mines, 2006.*//* All rights reserved.                       */#include	"sfhdr.h"/*	Obtain/release exclusive use of a stream.****	Written by Kiem-Phong Vo.*//* the main locking/unlocking interface */#if __STD_Cint sfmutex(Sfio_t* f, int type)#elseint sfmutex(f, type)Sfio_t*	f;int	type;#endif{#if !vt_threaded	NOTUSED(f); NOTUSED(type);	return 0;#else	SFONCE();	if(!f)		return -1;	if(!f->mutex)	{	if(f->bits&SF_PRIVATE)			return 0;		vtmtxlock(_Sfmutex);		f->mutex = vtmtxopen(NIL(Vtmutex_t*), VT_INIT);		vtmtxunlock(_Sfmutex);		if(!f->mutex)			return -1;	}	if(type == SFMTX_LOCK)		return vtmtxlock(f->mutex);	else if(type == SFMTX_TRYLOCK)		return vtmtxtrylock(f->mutex);	else if(type == SFMTX_UNLOCK)		return vtmtxunlock(f->mutex);	else if(type == SFMTX_CLRLOCK)		return vtmtxclrlock(f->mutex);	else	return -1;#endif /*vt_threaded*/}

⌨️ 快捷键说明

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