http://d.puremagic.com/issues/show_bug.cgi?id=4890

           Summary: GC.collect() deadlocks multithreaded program.
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: tomash.brec...@gmail.com


--- Comment #0 from Tomash Brechko <tomash.brec...@gmail.com> 2010-09-18 
14:31:41 PDT ---
The following program deadlocks with dmd 2.049 (all the time, though it may be
subject to a race):

import core.thread;
import core.memory;
import std.stdio;

class Job : Thread
{
  this()
  {
    super(&run);
  }

private:
  void run()
  {
    while (true)
      write("*");
  }
}

void
main()
{
  Job j = new Job;
  j.start();

  //j.sleep(1);

  GC.collect();

  while(true)
    write(".");
}

Uncommenting j.sleep(1); avoids the deadlock.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to