_lock_lock

获取多线程锁定。Acquires a multi-thread lock.

重要

此函数已过时。This function is obsolete. 从 Visual Studio 2015 开始,CRT 中不再提供此函数。Beginning in Visual Studio 2015, it is not available in the CRT.

语法Syntax

void __cdecl _lock  
   int locknum  
);  

参数Parameters

[in] locknum[in] locknum
要获取的锁定标识符。The identifier of the lock to acquire.

备注Remarks

如果已获取锁定,则此方法仍获取锁定会导致内部 C 运行时 (CRT) 错误。If the lock has already been acquired, this method acquires the lock anyway and causes an internal C run-time (CRT) error. 如果此方法无法获取锁定,则它将退出并显示错误,同时将错误代码设置为 _RT_LOCKIf the method cannot acquire a lock, it exits with a fatal error and sets the error code to _RT_LOCK.

惠?Requirements

源: mlock.cSource: mlock.c

请参阅See Also

按字母顺序的函数参考 Alphabetical Function Reference
_unlock_unlock