On Wed, February 18, 2009 8:15 am, Krzysztof Foltman wrote:
>> Yes, it is the MIDI thread -- but it *could be* anyone.
>
> It could only be MIDI or audio thread (because the GUI thread is the one
> that calls the initial get_instance() in first place).

Well... it appears to be mostly moot.  I got the latest trunk and it works
for me.  :-)

However, what I was getting at is that there are about 2 threads at the
first call of get_instance() and 5 at the second call.  What's to stop a
developer from trying to call it from another thread?

> This is a nice pattern (I use it in calf), but it doesn't work when the
> code called from constructor calls get_hydrogen_instance again (which is
> what we're currently dealing with):

Thanks for the example.  You're right.  What about the code below?

#include <stdio.h>

class A {
public:
    A() { printf("Ctor\n"); A::get(); }
    static A* get() { return &a; }
private:
    static A a;
};

A A::a;

int main()
{
    A::get();
    return 0;
}


-- 
               G a b r i e l   M   B e d d i n g f i e l d


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel

Reply via email to