术语 | leavecriticalsection |
释义 | LeaveCriticalSection 语法: C++ void WINAPI LeaveCriticalSection( __inout LPCRITICAL_SECTION lpCriticalSection ); LeaveCriticalSection函数 公告指定的临界区对象的所有权。 参数 lpCriticalSection [ in , out ] 一个临界区对象的指针。 返回值 这个函数没有返回值。 备注 单个进程的线程可以使用一个互斥同步临界区对象。这个过程是负责分配的一个关键节对象,它可以通过声明类型的CRITICAL_SECTION的变量使用的内存。之前使用一个关键部分,一些进程中的线程必须调用InitializeCriticalSection或InitializeCriticalSectionAndSpinCount函数来初始化对象。 一个线程使用加锁或TryEnterCriticalSection函数来获得一个关键节对象的所有权。要释放的所有权,该线程必须要求每次LeaveCriticalSection一旦它进入临界区。 如果一个线程调用LeaveCriticalSection时,它没有指定的临界区对象的所有权,就会出现错误,可能会导致另一个线程使用加锁无限期地等待。 任何进程中的线程可以使用DeleteCriticalSection函数来释放分配制度时,关键节对象初始化的资源。在此之后的功能被称为临界区对象不能用于同步。 实例 举一个例子,它使用LeaveCriticalSection,请参阅使用临界区对象。 要求: 最低支持:client-Windows 2000专业版 最低支持server-Windows 2000服务器 HeaderWinbase.h(头文件:winuser.h) LibraryKernel32.lib DLLKernel32.dll 参见 临界区对象 DeleteCriticalSection 加锁 InitializeCriticalSection InitializeCriticalSectionAndSpinCount 同步功能 TryEnterCriticalSection 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年8月27日 ==英文原文==LeaveCriticalSection Function Releases ownership of the specified critical section object. Syntax C++ void WINAPI LeaveCriticalSection( __inout LPCRITICAL_SECTION lpCriticalSection ); Parameters lpCriticalSection [in, out] A pointer to the critical section object. Return Value This function does not return a value. Remarks The threads of a single process can use a critical-section object for mutual-exclusion synchronization. The process is responsible for allocating the memory used by a critical-section object, which it can do by declaring a variable of type CRITICAL_SECTION. Before using a critical section, some thread of the process must call the InitializeCriticalSection or InitializeCriticalSectionAndSpinCount function to initialize the object. A thread uses the EnterCriticalSection or TryEnterCriticalSection function to acquire ownership of a critical section object. To release its ownership, the thread must call LeaveCriticalSection once for each time that it entered the critical section. If a thread calls LeaveCriticalSection when it does not have ownership of the specified critical section object, an error occurs that may cause another thread using EnterCriticalSection to wait indefinitely. Any thread of the process can use the DeleteCriticalSection function to release the system resources that were allocated when the critical section object was initialized. After this function has been called, the critical section object can no longer be used for synchronization. Examples For an example that uses LeaveCriticalSection, see Using Critical Section Objects . Requirements Minimum supported clientWindows 2000 Professional Minimum supported serverWindows 2000 Server HeaderWinbase.h (include Windows.h) LibraryKernel32.lib DLLKernel32.dll See Also Critical Section Objects DeleteCriticalSection EnterCriticalSection InitializeCriticalSection InitializeCriticalSectionAndSpinCount Synchronization Functions TryEnterCriticalSection Send comments about this topic to Microsoft Build date: 8/27/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/ms684169(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。