Hi Adrian,

I'm open to the idea of adding a thread name to OpenThreads::Thread,
it'll have to be a feature that works consistently across all
platforms.

I'm not not familiar with Win32 threading, but looking at your code it
looks like Windows directly supports a thread name a thread local
storage.  Does the debugger look for this for the name?

Robert.

On 4/19/07, Adrian Egli <[EMAIL PROTECTED]> wrote:
hi

i would like to add to the Thread (OpenThread) interface following methode:

void setThreadMarkerName(std::string )

setThreadMarkerName(std::String marker ){
CallSetThreadName ( thread id, marker);
}

                            void CallSetThreadName(unsigned long dwThreadID,
const char* szThreadName){
                                THREADNAME_INFO info;
                                {
                                    info.dwType = 0x1000;
                                    info.szName = szThreadName;
                                    info.dwThreadID = dwThreadID;
                                    info.dwFlags = 0;
                                }
                                __try
                                {
                                    RaiseException( 0x406D1388, 0,
sizeof(info)/sizeof(unsigned long), (unsigned long*)&info );
                                }
                                __except (-1)
                                {
                                }
                            }


At least for windows and under debug it would be more esier to recognize the
right thread in VS. if the community would be please to get such a feature
included
il will prepare a propre implementation of this feature for check in
(commit)

adegli

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to