Closed kntroh closed 9 years ago
I'm not sure if this is the correct solution. I know the druntime developers want to make lock.wait nothrow
. Which will break this code [1]. I'm wondering if we should copy the current implementation of lock.wait
to DWT instead and do all this ourself. See [2] for reference.
In future, SyncError will be changed to return value?
If so, I can write this:
static if (is(typeof(lock.wait()) == void)) {
try {
lock.wait();
} catch (SyncError e) {
interrupted = true;
}
} else {
interrupted = lock.wait();
}
Unfortunately no. lock.wait
will still return void
and will thrown an error instead of an exception. It's legal to throw errors in a function declared as nothrow
. Errors are not supposed to be catchable and should immediately halt the application. Technically you can catch an error today, but this can change in any new release.
See this pull request [1] of how the code will most likely look like. The pull request was merged but has since then been reverted. It caused some problems with vibe.d when updating that to DMD 2.067.0.
[1] https://github.com/D-Programming-Language/druntime/pull/1013/files
Sorry, I don't know what to do solve this problem.
Maybe we should copy the old condition.d to DWT base.
https://github.com/D-Programming-Language/druntime/blob/2.066/src/core/sync/condition.d
Maybe we should copy the old condition.d to DWT base.
That's exactly what I was thinking.
I copied it now. And sent pull request for DWT base.
Updated this pull request.
Is this necessary for Linux also?
I'll check it from now.
By the way, There is a problem with the current DWT linux.
I had worked for linux 64 version few month ago. (the work is based on working of JinShil.) But it didn't worked well. The current DWT based on GNOME2 maybe. And GNOME3 the API has been changed from 2. I'm not able to cope with it yet.
Thanks for all your fixes.
By the way, There is a problem with the current DWT linux.
I'm not sure I understand. Is the problem that DWT is based on GNOME2 and not 3?
In GNOME3, Structures such as GtkWidget and GtkWindow is encapsulated. If use a structure member directly, Access Violation occurs.
We need to fixes such codes. For example: https://github.com/kntroh/org.eclipse.swt.gtk.linux.x86/blob/for2067linux/src/org/eclipse/swt/internal/gtk/OS.d#L2305
It was difficult for me.
How important is it to support GNOME3?
BTW, I've started to work on a tool to automatically port SWT to D. It's available here [1].
How important is it to support GNOME3?
Oh, It isn't important now. I'll reconsider.
BTW, I've started to work on a tool to automatically port SWT to D. It's available here [1].
It's the goal of the DWT certainly. I learn Scala when I have time.
SWT 4.3 added early access support for GTK3 and in 4.4 it became the default version (if installed). DWT is very far behind that. I'm not sure how much sense it makes to update DWT, at the current version, to support GTK3. Personally I will put my time in JPort and try to make that useable. If you would like to add support for GTK3 I will gladly accept pull requests.
Thanks. If I get results, I will send it.
Fixes for dmd 2.067.0.
I removed compile error and warning.