mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-08-27 09:03:27 +02:00
Utilities: BlockingQueue: Bugfix: TryDequeue would block infinitely if called after Stop was invoked
This commit is contained in:
parent
351f23ead9
commit
21313ac030
1 changed files with 6 additions and 4 deletions
|
@ -1,13 +1,11 @@
|
|||
/* Copyright (C) 2016-2020 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
||||
/* Copyright (C) 2016-2025 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
||||
*
|
||||
* You can redistribute this program and/or modify it under the terms of
|
||||
* the GNU Lesser Public License as published by the Free Software Foundation,
|
||||
* either version 3 of the License, or (at your option) any later version.
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Text;
|
||||
|
||||
namespace Utilities
|
||||
{
|
||||
|
@ -57,7 +55,11 @@ namespace Utilities
|
|||
{
|
||||
while (m_queue.Count == 0)
|
||||
{
|
||||
Monitor.Wait(m_queue);
|
||||
if (!m_stopping)
|
||||
{
|
||||
Monitor.Wait(m_queue);
|
||||
}
|
||||
|
||||
if (m_stopping)
|
||||
{
|
||||
item = default(T);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue