问题描述
这是什么BlockingCollection.Dispose实际上做?
What does BlockingCollection.Dispose actually do?
推荐答案
这使得内部等待处理,以妥善处理。
This allows the internal wait handles to be disposed of properly.
BlockingCollection< T>
,在内部,使用一对事件等待句柄,这反过来又具有相关联的原生 HANDLE
。
BlockingCollection<T>
, internally, uses a pair of event wait handles, which in turn have an associated native HANDLE
.
具体而言, BlockingCollection&LT; T&GT; .Dispose()
发布这两个把手回操作系统,以最终(通过SemaphoreSlim->的ManualResetEvent)调用本机 CloseHandle的上的两个本地处理方法
实例。
Specifically, BlockingCollection<T>.Dispose()
releases these two handles back to the operating system, by eventually (through SemaphoreSlim->ManualResetEvent) calling the native CloseHandle method on the two native HANDLE
instances.
这篇关于什么是BlockingCollection.Dispose实际上做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!