Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Conversation

MartinNowak
Copy link
Member

  • require Object.Monitor lock and unlock functions to be nothrow
  • change methods of all core.sync classes to nothrow

Requires dmd pull dlang/dmd#4115
Issue 11216

@MartinNowak
Copy link
Member Author

As this changes the API of the Object.Monitor interface it can potentially break client code that implements this interface. I couldn't come up with an idea how to avoid this, but it will only affect very few people and it will be simple to fulfill the nothrow requirement.

@MartinNowak
Copy link
Member Author

requires dlang/phobos#2704 which in turn requires #1021

This was referenced Nov 17, 2014
@MartinNowak
Copy link
Member Author

Need to nothrow the osx semaphore headers.

- require Object.Monitor lock and unlock functions to be nothrow

- change methods of all core.sync classes to nothrow
@MartinNowak
Copy link
Member Author

Updated

@DmitryOlshansky
Copy link
Member

LGTM

@MartinNowak
Copy link
Member Author

Well, the compiler change for _d_monitorenter and _d_monitorexit is already in.
Classes implementing Object.Monitor should be scarce outside of core.sync.

it will be simple to fulfill the nothrow requirement

At worse, scope (failure) assert(0); can be used to turn any function into a nothrow function, useful for practical nothrow functions that aren't nothrow because of missing annotations. Credit for that idiom goes to Kenji.

So unless there are any further objections, I'll merge this soon.

@DmitryOlshansky
Copy link
Member

Auto-merge toggled on

@DmitryOlshansky
Copy link
Member

Since we already march in this way and opposition is rather weak I'm merging it.

DmitryOlshansky added a commit that referenced this pull request Dec 12, 2014
fix Issue 11216 - Make synchronized statement `nothrow`
@DmitryOlshansky DmitryOlshansky merged commit 46061e6 into dlang:master Dec 12, 2014
@MartinNowak
Copy link
Member Author

Thx

@MartinNowak
Copy link
Member Author

scope (failure) assert(0);

Even better because it checks nothrow in 2.067.

static if (__VERSION__ <= 2066)
    scope (failure) assert(0, "should be nothrow");

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants