Skip to content

Commit f1003a9

Browse files
committed
Remove dependency on LexicalCast
1 parent 710e6fd commit f1003a9

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

src/pthread/thread.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
#include <vxCpuLib.h>
3535
#endif
3636

37-
#include <boost/lexical_cast.hpp>
38-
3937
#include <fstream>
4038
#include <string>
4139
#include <set>
@@ -548,12 +546,22 @@ namespace boost
548546
value = thread_detail::string_trim( value );
549547

550548
if (key == physical_id) {
551-
current_core_entry.first = boost::lexical_cast<unsigned>(value);
549+
550+
if( !thread_detail::string_to_unsigned( value, current_core_entry.first ) )
551+
{
552+
return hardware_concurrency();
553+
}
554+
552555
continue;
553556
}
554557

555558
if (key == core_id) {
556-
current_core_entry.second = boost::lexical_cast<unsigned>(value);
559+
560+
if( !thread_detail::string_to_unsigned( value, current_core_entry.second ) )
561+
{
562+
return hardware_concurrency();
563+
}
564+
557565
cores.insert(current_core_entry);
558566
continue;
559567
}

0 commit comments

Comments
 (0)