[Ace-users] [ace-users] Task name in VxWorks
Kordonsky Alex
alex_k at elbit.co.il
Mon Oct 8 01:33:37 CDT 2007
ACE VERSION: 5.5
HOST MACHINE and OPERATING SYSTEM:
WindowsXP , SP2
Winsock2
TARGET MACHINE and OPERATING SYSTEM,
PPC , VxWorks 5.5/ Tornado 2.2.1
COMPILER NAME AND VERSION (AND PATCHLEVEL): gcc 2.96
CONTENTS OF $ACE_ROOT/ace/config.h
config-vxworks5.x
CONTENTS OF $ACE_ROOT/include/makeinclude/platform_macros.GNU
(unless
this isn't used in this case, e.g., with Microsoft Visual C++):
AREA/CLASS/EXAMPLE AFFECTED:
None
DOES THE PROBLEM AFFECT:
OTHER (please specify)?
Task name in VxWorks
SYNOPSIS:
[Brief description of the problem]
DESCRIPTION:
How I can define task ( thread ) name during creation in
VxWorks?
I succeded to give task name using ACE_thread_t argument in
spawn function.
But my code runs on VxWorks and Windows XP and I didn't find
cross
platform way ( without using #ifdef VXWORKS ) to solve this
problem
SAMPLE FIX/WORKAROUND:
std::string thread_name("My Thread") ;
char* p_thread_name = (char*)thread_name.c_str() ;
ACE_Thread_Manager::instance()->spawn (
ACE_THR_FUNC( server) ,
reinterpret_cast<void*>(thread_arg) ,
THR_NEW_LWP | THR_DEAMON
#ifdef VXWORKS
| VX_FP_TASK , &p_thread_name
#endif
) ;
In this way thread_name and p_thread_name is unused variables in
Windows XP.
May be somebody can advise portable solution?
Alexander Kordonsky
Senior Software Engineer
Elbit System Group
e-mail : alex_k at elbit.co.il
tel : 972-4-831-62-29
mobile: 972-54-999-62-29
This e-mail message has been sent by Elbit Systems Ltd.
and is for the use of the intended recipients only.
The message may contain privileged or commercially sensitive information .
If you are not the intended recipient you are hereby notified that any use,
distribution or copying of this communication is strictly prohibited,
and you are requested to delete the e-mail and any attachments
and notify the sender immediately.
More information about the Ace-users
mailing list