www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14495] New: executeInNewThread should return Thread


          Issue ID: 14495
           Summary: executeInNewThread should return Thread
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: andrey.zherikov gmail.com

executeInNewThread caller should have an access to created thread.
For example to set daemon thread:

import std.parallelism;
import core.thread;

void long_operation() { Thread.sleep(dur!("seconds")(5)); }

void main()
    Thread task_thread = task!long_operation.executeInNewThread;
    task_thread.isDaemon = true;

Apr 24 2015