opendlang / opend

Boost Software License 1.0
84 stars 18 forks source link

Add Event OS API #49

Closed IgorDeepakM closed 7 months ago

IgorDeepakM commented 7 months ago

That's the last of the reorganization of the druntime in the sync folder. Except the config.d file which seems to be POSIX only, I leave it for now and later it might be more clear what to do with it.

Now I'm on with rearranging all this again but using a global configuration file instead.

After that I'm going for the thread and memory API.

denizzzka commented 7 months ago

If you are touching event API I also suggest another proposal in addition to it: rewrite Event (with renaming, of course) to avoid unnecessary IfInitialized checks for each Event method call - it is better to use RAII instead

I mean here what:

    void setIfInitialized() nothrow @trusted @nogc
    {
        if (m_initalized) // <- this line
        {
[...]
    void setIfInitialized() nothrow @trusted @nogc
    {
        if (m_event) // <- and this line
            SetEvent(m_event);
    }

is redundant checks but it is need because constructor isn't initializes Event for some reason

Upd: I just feel that these checks are pointless, just a strange design