$FUNCNAME$
	START()
$CATEGORY$
	TASK, CODEBLOCK
$SUMMARY$
	Start task.
$LANG_RU$
	 .
$SYNTAX$
     START(<vTask>, [<vPar1>,,, <vParN>]) 	--> <nTaskID>
$ARGUMENTS$
	<vTask>		Is the function name, or code block, or address of static function.
	<vPar1>...<vParN> Is are some parameters for task.
$LANG_RU$
	<vTask>		 ,   ,    .
	<vPar1>...<vParN> ,   .
$RETURNS$
     Returns numeric value - is the task identifier.
$LANG_RU$
        -  .
$DESCRIPTION$
	START() starts task in parallel mode and passes it some parameters <vPar1>,,, <vParN>.
$LANG_RU$
	START()         
	<vPar1>,,, <vParN>
$EXAMPLES$



ts := @task2()
  ...

? START("task1", "Ann", "Jhon", "Mary")
  ...
? START(ts, 200, 100)
  ...
? START({|p1, p2| qout("Start code block"), ..., qout("Code block finished")})
  ...

function task1(a, b, c)
	qout('Start task1')
	...
	qout('task1 finished')
return .T.

static function task2(x, y)
	qout('Start task2')
	...
	qout('task2 finished')
return

$PLATFORMS$
   No dependies of platform.
   $LANG_RU$
      
$SEEALSO$
	TASKSTOP(), TASKSTART()
$AUTHOR$
ITK
   $LANG_RU$

$END$

$FUNCNAME$
	TASKSTOP()
$CATEGORY$
	TASK
$SUMMARY$
	Stop all tasks with the exclusion current task.
$LANG_RU$
	  ,   .
$SYNTAX$
     TASKSTOP() 	--> NIL
$ARGUMENTS$
$RETURNS$
     Returns NIL.
$LANG_RU$
      NIL.
$DESCRIPTION$
	TASKSTOP() stopeds all tasks with the exclusion current task.
$LANG_RU$
	TASKSTOP()   ,   .
$EXAMPLES$


function Task_stop()
	TASKSTOP()
	....
return

$PLATFORMS$
   No dependies of platform.
   $LANG_RU$
      
$SEEALSO$
	TASKSTART()
$AUTHOR$
ITK
   $LANG_RU$

$END$

$FUNCNAME$
	TASKSTART()
$CATEGORY$
	TASK
$SUMMARY$
	Resume all tasks what was stopped.
$LANG_RU$
	  ,   .
$SYNTAX$
     TASKSTART() 	--> NIL
$ARGUMENTS$
$RETURNS$
     Returns NIL.
$LANG_RU$
      NIL.
$DESCRIPTION$
	TASKSTART() resumes all tasks what was stopped of function TASKSTOP().
$LANG_RU$
	TASKSTART()   ,     TASKSTOP().
$EXAMPLES$


function Task_stop()
	TASKSTOP()
	....
return

....
Task_stop()

TASKSTART()

$PLATFORMS$
   No dependies of platform.
   $LANG_RU$
      
$SEEALSO$
	TASKSTOP()
$AUTHOR$
ITK
   $LANG_RU$

$END$



$FUNCNAME$
	TASKID()
$CATEGORY$
	TASK
$SUMMARY$
	Return task identifier.
$LANG_RU$
	  .
$SYNTAX$
     TASKID() 	--> <nTaskID>
$ARGUMENTS$
$RETURNS$
     Returns task identifier as numeric value.
$LANG_RU$
          .
$DESCRIPTION$
	TASKID() returns current task identifier <nTaskID> as numeric value.
$LANG_RU$
	TASKID()     <nTaskID>   .
$EXAMPLES$


TASKSTOP()

? TASKID()

TASKSTART()

$PLATFORMS$
   No dependies of platform.
   $LANG_RU$
      
$SEEALSO$
$AUTHOR$
ITK
   $LANG_RU$

$END$



$FUNCNAME$
	TASKSENDMSG()
$CATEGORY$
	TASK
$SUMMARY$
	Send message to task.
$LANG_RU$
	  .
$SYNTAX$
     TASKSENDMSG(<nReceiverID>, <vMsg>[, <lWait>]) 	--> <lResult>
$ARGUMENTS$
	<nReceiverID>	NUMERIC, is the identifier of task receiver.
	<vMsg>		is the any type data - message to task.
	<lWait>		Logical, is TRUE if function must wait processed.
$LANG_RU$
	<nReceiverID>	NUMERIC,  -.
	<vMsg>		 ""   .
	<lWait>		Logical, TRUE,      .
$RETURNS$
     Returns logical value <lResult>, TRUE if message was delivered.
$LANG_RU$
        <lResult>, TRUE    .
$DESCRIPTION$
	TASKSENDMSG() sends var <vMsg> to task with identifier <nReceiverID> and returns
	returns TRUE if operation successfully.
$LANG_RU$
	TASKSENDMSG()   <vMsg>    <nReceiverID> 
	 TRUE,    .
$EXAMPLES$

static id

id := START("func1")

for i:=1 to 10
	TASKSENDMSG(id, time())
	sleep(i)
next

....

function func1()
	do while .T.
		? "task got: ", TASKGETMSG()
	enddo
return

$PLATFORMS$
   No dependies of platform.
   $LANG_RU$
      
$SEEALSO$
	TASKGETMSG(), TASKPEEKMSG()
$AUTHOR$
ITK
   $LANG_RU$

$END$



$FUNCNAME$
	TASKGETMSG()
$CATEGORY$
	TASK
$SUMMARY$
	Get message.
$LANG_RU$
	  .
$SYNTAX$
     TASKGETMSG() 	--> <vMsg>
$ARGUMENTS$
$RETURNS$
     Returns var <vMsg>, what was sended from a TASKSENDMSG().
$LANG_RU$
       ,     TASKSENDMSG().
$DESCRIPTION$
	TASKGETMSG() gets message from task input queue and returns it. If no
	message available, waits forever.
$LANG_RU$
	TASKGETMSG()         .
	     -  .
$EXAMPLES$

static id

id := START("func1")

for i:=1 to 10
	TASKSENDMSG(id, time())
	sleep(i)
next

....

function func1()
	do while .T.
		? "task got: ", TASKGETMSG()
	enddo
return

$PLATFORMS$
   No dependies of platform.
   $LANG_RU$
      
$SEEALSO$
	TASKSENDMSG(), TASKPEEKMSG()
$AUTHOR$
ITK
   $LANG_RU$

$END$


$FUNCNAME$
	TASKPEEKMSG()
$CATEGORY$
	TASK
$SUMMARY$
	Get message.
$LANG_RU$
	  .
$SYNTAX$
     TASKPEEKMSG() 	--> <vMsg>
$ARGUMENTS$
$RETURNS$
     Returns var <vMsg>, what was sended from a TASKSENDMSG().
$LANG_RU$
       ,     TASKSENDMSG().
$DESCRIPTION$
	TASKPEEKMSG() gets message from task input queue and returns it. If no
	message available, immediatly returns NIL.
$LANG_RU$
	TASKPEEKMSG()         .
	     -   NIL.
$EXAMPLES$

static id

id := START("func1")

for i:=1 to 10
	TASKSENDMSG(id, time())
	sleep(i)
next

....

function func1()
	do while .T.
		? "task got: ", TASKPEEKMSG()
	enddo
return

$PLATFORMS$
   No dependies of platform.
   $LANG_RU$
      
$SEEALSO$
	TASKSENDMSG(), TASKGETMSG()
$AUTHOR$
ITK
   $LANG_RU$

$END$

