Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 2450

Show
Ignore:
Timestamp:
07/12/07 15:08:13 (1 year ago)
Author:
kris
Message:

simplified Task usage via TLS

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/net/cluster/NetworkCall.d

    r2446 r2450  
    1414 
    1515private import tango.core.Traits; 
     16private import tango.core.Thread; 
     17 
     18private import tango.net.cluster.tina.Cluster; 
     19 
     20private import tango.net.cluster.NetworkMessage; 
    1621 
    1722protected import tango.io.protocol.model.IReader, 
     
    2025protected import tango.net.cluster.model.IChannel; 
    2126 
    22 private   import tango.net.cluster.NetworkMessage; 
    23  
    24 /******************************************************************************* 
    25  
     27 
     28/******************************************************************************* 
     29 
     30        Interim bootstrap for cluster connectivity  
     31 
     32*******************************************************************************/ 
     33 
     34static this () 
     35
     36        auto cluster = (new Cluster).join; 
     37        Thread.setLocal (0, cast(void*) cluster.createChannel("task")); 
     38
     39 
     40 
     41/******************************************************************************* 
     42 
     43        task harness, for initiating the send 
    2644 
    2745*******************************************************************************/ 
     
    3856                    channel.execute (this); 
    3957                else 
    40                    execute; 
     58                   { 
     59                   auto x = cast(IChannel) Thread.getLocal(0); 
     60                   if (x) 
     61                       x.execute (this); 
     62                   else 
     63                      execute; 
     64                   } 
    4165        } 
    4266}