2020-01-02 19:08:37 +08:00
|
|
|
|
#Region "Microsoft.VisualBasic::497600900f97d7e319fec3b8ee15cd98, Microsoft.VisualBasic.Core\My\InnerQueue.vb"
|
2018-09-07 23:54:13 +08:00
|
|
|
|
|
2018-09-08 01:26:45 +08:00
|
|
|
|
' Author:
|
|
|
|
|
|
'
|
|
|
|
|
|
' asuka (amethyst.asuka@gcmodeller.org)
|
|
|
|
|
|
' xie (genetics@smrucc.org)
|
|
|
|
|
|
' xieguigang (xie.guigang@live.com)
|
|
|
|
|
|
'
|
|
|
|
|
|
' Copyright (c) 2018 GPL3 Licensed
|
|
|
|
|
|
'
|
|
|
|
|
|
'
|
|
|
|
|
|
' GNU GENERAL PUBLIC LICENSE (GPL3)
|
|
|
|
|
|
'
|
|
|
|
|
|
'
|
|
|
|
|
|
' This program is free software: you can redistribute it and/or modify
|
|
|
|
|
|
' it under the terms of the GNU General Public License as published by
|
|
|
|
|
|
' the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
|
' (at your option) any later version.
|
|
|
|
|
|
'
|
|
|
|
|
|
' This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
' but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
' GNU General Public License for more details.
|
|
|
|
|
|
'
|
|
|
|
|
|
' You should have received a copy of the GNU General Public License
|
|
|
|
|
|
' along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2018-09-07 23:54:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-08 01:26:45 +08:00
|
|
|
|
' /********************************************************************************/
|
2018-09-07 23:54:13 +08:00
|
|
|
|
|
2018-09-08 01:26:45 +08:00
|
|
|
|
' Summaries:
|
2018-09-07 23:54:13 +08:00
|
|
|
|
|
2018-09-08 01:26:45 +08:00
|
|
|
|
' Module InnerQueue
|
|
|
|
|
|
'
|
|
|
|
|
|
' Properties: InnerThread
|
|
|
|
|
|
'
|
|
|
|
|
|
' Sub: AddToQueue, WaitQueue
|
|
|
|
|
|
'
|
|
|
|
|
|
'
|
|
|
|
|
|
' /********************************************************************************/
|
2018-09-07 23:54:13 +08:00
|
|
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
2018-09-08 01:13:40 +08:00
|
|
|
|
Imports System.Runtime.CompilerServices
|
2018-09-07 23:54:13 +08:00
|
|
|
|
Imports Microsoft.VisualBasic.Parallel
|
|
|
|
|
|
|
|
|
|
|
|
Namespace My
|
|
|
|
|
|
|
|
|
|
|
|
''' <summary>
|
|
|
|
|
|
''' Task action Queue for terminal QUEUE SOLVER 🙉
|
|
|
|
|
|
''' </summary>
|
|
|
|
|
|
Module InnerQueue
|
|
|
|
|
|
|
2019-11-25 19:42:43 +08:00
|
|
|
|
''' <summary>
|
|
|
|
|
|
''' The internal task queue of the sciBASIC.NET framework
|
|
|
|
|
|
''' </summary>
|
|
|
|
|
|
''' <returns></returns>
|
2018-09-08 00:38:41 +08:00
|
|
|
|
Public ReadOnly Property InnerThread As New ThreadQueue
|
2018-09-07 23:54:13 +08:00
|
|
|
|
|
|
|
|
|
|
''' <summary>
|
|
|
|
|
|
''' 添加终端输出的任务到任务队列之中
|
|
|
|
|
|
''' </summary>
|
|
|
|
|
|
''' <param name="task"></param>
|
2018-09-08 01:13:40 +08:00
|
|
|
|
'''
|
|
|
|
|
|
<MethodImpl(MethodImplOptions.AggressiveInlining)>
|
2018-09-07 23:54:13 +08:00
|
|
|
|
Public Sub AddToQueue(task As Action)
|
|
|
|
|
|
Call InnerThread.AddToQueue(task)
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
''' <summary>
|
|
|
|
|
|
''' Wait for all thread queue job done.(Needed if you are using multiThreaded queue)
|
|
|
|
|
|
''' </summary>
|
2018-09-08 01:13:40 +08:00
|
|
|
|
'''
|
|
|
|
|
|
<MethodImpl(MethodImplOptions.AggressiveInlining)>
|
2018-09-07 23:54:13 +08:00
|
|
|
|
Public Sub WaitQueue()
|
|
|
|
|
|
Call InnerThread.WaitQueue()
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
End Module
|
|
|
|
|
|
End Namespace
|