[Issue 11594] New: synchronized causing segfault instead of Error.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 24 11:42:33 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11594

           Summary: synchronized causing segfault instead of Error.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody at puremagic.com
        ReportedBy: shammah.chancellor at gmail.com


--- Comment #0 from Shammah Chancellor <shammah.chancellor at gmail.com> 2013-11-24 11:42:32 PST ---
I'm not sure why this segfaults, since core.sync.mutex has an in contract to
check for null?  I am compiling in debug mode.

import std.stdio;

private Object mut;// = new Object();                                           

void lockedFunction()
{
  synchronized(mut)  //I asume this makes does auto mutex = new Mutex(mut) and
then mutex.lock()?
    {
      writefln("Whoops");
    } //mutex.unlock();?

   /* Also results in segfault:
  auto mutex = new Mutex(mut);
  mutex.lock();
      writefln("Whoops");
  mutex.unlock();
*/
}

void main()
{
  lockedFunction();
}

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


More information about the Digitalmars-d-bugs mailing list