    [NAME]
    ALL.dao.module.mt

    [TITLE]
    Built-in Multi-threading Module

    [DESCRIPTION]

     0.1   Mutex Methods

       1  mutex()=>mutex
       2  lock( self : mutex )
       3  unlock( self : mutex )
       4  trylock( self : mutex )=>int
       5  protect( self : mutex )[]

     0.2   Condition Variable Methods

       1  condition()=>condition
       2  wait( self : condition, mtx : mutex )
       3  timedwait( self : condition, mtx : mutex, seconds :float )=>int
       4  signal( self : condition )
       5  broadcast( self : condition )

     0.3   Semaphore Methods

       1  semaphore( value = 0 )=>semaphore
       2  wait( self : semaphore )
       3  post( self : semaphore )
       4  setvalue( self : semaphore, n :int )
       5  getvalue( self : semaphore )=>int
       6  protect( self : semaphore )[]

     0.4   Module Methods

       1  critical()[]
       2  start( when : enum<auto,now> = $auto )[=>@V] =>future<@V>
       3  iterate( times :int, threads=2 )[index:int,threadid:int]
       4
       5  iterate( alist :list<@T>, threads=2 )[item:@T,index:int,threadid:int]
       6  map( alist :list<@T>, threads=2 )[item:@T,index:int,threadid:int =>@T2] =>list<@T2>
       7  apply( alist :list<@T>, threads=2 )[item:@T,index:int,threadid:int =>@T] =>list<@T>
       8  find( alist :list<@T>, threads=2 )[item:@T,index:int,threadid:int =>int] =>tuple<index:int,item:@T>|none
       9
      10  iterate( amap :map<@K,@V>, threads=2 )[key:@K,value:@V,threadid:int]
      11  map( amap :map<@K,@V>, threads=2 )[key:@K,value:@V,threadid:int =>@T] =>list<@T>
      12  apply( amap :map<@K,@V>, threads=2 )[key:@K,value:@V,threadid:int =>@V] =>map<@K,@V>
      13  find( amap :map<@K,@V>, threads=2 )[key:@K,value:@V,threadid:int =>int] =>tuple<key:@K,value:@V>|none
      14
      15  iterate( aarray :array<@T>, threads=2 )[item:@T,I:int,J:int,K:int,L:int,M:int,threadid:int]
      16  map( aarray :array<@T>, threads=2 )[item:@T,I:int,J:int,K:int,L:int,M:int,threadid:int =>@T2] =>array<@T2>
      17  apply( aarray :array<@T>, threads=2 )[item:@T,I:int,J:int,K:int,L:int,M:int,threadid:int =>@T] =>array<@T>