C#中的信号量超时机制
有谁知道 .NET 如何处理调用 Semaphore.WaitOne(timeout)
的超时?
我期望出现 TimeoutException
,但 MSDN 文档并未将其列在预期异常列表中,而且我似乎无法在任何地方找到它的记录。
Does anyone know how .NET handles a timeout on a call to Semaphore.WaitOne(timeout)
?
I'd expect a TimeoutException
, but the MSDN documentation doesn't list this in the list of expected exceptions, and I can't seem to find it documented anywhere.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果超时,该方法将返回
false
;如果返回信号,则返回true
:The method will return
false
if it times out, andtrue
if it returns a signal: