[complement-svn] SF.net SVN: complement: [1423] trunk/complement/explore
Status: Pre-Alpha
Brought to you by:
complement
From: <com...@us...> - 2006-11-29 11:55:21
|
Revision: 1423 http://svn.sourceforge.net/complement/?rev=1423&view=rev Author: complement Date: 2006-11-29 03:55:20 -0800 (Wed, 29 Nov 2006) Log Message: ----------- code reorganization to avoid problems with order of static objects dtors calls and libraries unload order; libxmt: version 1.9.3 Modified Paths: -------------- trunk/complement/explore/include/mt/uid.h trunk/complement/explore/lib/mt/ChangeLog trunk/complement/explore/lib/mt/uid.cc Modified: trunk/complement/explore/include/mt/uid.h =================================================================== --- trunk/complement/explore/include/mt/uid.h 2006-11-29 08:07:54 UTC (rev 1422) +++ trunk/complement/explore/include/mt/uid.h 2006-11-29 11:55:20 UTC (rev 1423) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/11/27 18:07:44 ptr> +// -*- C++ -*- Time-stamp: <06/11/29 13:38:05 ptr> /* * Copyright (c) 2006 @@ -62,7 +62,7 @@ } }; -const std::string& hostid_str(); +const char *hostid_str(); const xmt::uuid_type& hostid(); } // namespace xmt Modified: trunk/complement/explore/lib/mt/ChangeLog =================================================================== --- trunk/complement/explore/lib/mt/ChangeLog 2006-11-29 08:07:54 UTC (rev 1422) +++ trunk/complement/explore/lib/mt/ChangeLog 2006-11-29 11:55:20 UTC (rev 1423) @@ -5,6 +5,9 @@ really. I use syscall here and rewrite appropriate var during Thread::fork(). + * uid.h, uid.cc: code reorganization to avoid problems with order + of static objects dtors calls and libraries unload order. + * libxmt: version 1.9.3 2006-11-23 Petr Ovtchenkov <pt...@is...> Modified: trunk/complement/explore/lib/mt/uid.cc =================================================================== --- trunk/complement/explore/lib/mt/uid.cc 2006-11-29 08:07:54 UTC (rev 1422) +++ trunk/complement/explore/lib/mt/uid.cc 2006-11-29 11:55:20 UTC (rev 1423) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/11/28 12:31:04 ptr> +// -*- C++ -*- Time-stamp: <06/11/29 13:38:19 ptr> /* * Copyright (c) 2006 @@ -13,6 +13,7 @@ #include <fstream> #include <sstream> #include <iomanip> +#include <cstring> namespace xmt { @@ -26,22 +27,25 @@ public: __uid_init(); - static Mutex _lk; static uuid_type _host_id; - static string _host_id_str; + static char _host_id_str[48]; // 37 really }; -Mutex __uid_init::_lk; uuid_type __uid_init::_host_id; -string __uid_init::_host_id_str; +char __uid_init::_host_id_str[48]; __uid_init::__uid_init() { + static Mutex _lk; + Locker lock( _lk ); ifstream f( "/proc/sys/kernel/random/boot_id" ); - getline( f, _host_id_str ); + string tmp; + getline( f, tmp ); + strcpy( _host_id_str, tmp.c_str() ); + stringstream s; s << _host_id_str[0] << _host_id_str[1] << ' ' << _host_id_str[2] << _host_id_str[3] << ' ' @@ -81,7 +85,7 @@ } // namespace detail -const std::string& hostid_str() +const char *hostid_str() { static detail::__uid_init _uid; return detail::__uid_init::_host_id_str; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |