Fix issue with setting of thread name
Only first 3 chars of thread name were getting set because of incorrect length check. This change fixes the issue. CRs-Fixed: 2376235 Change-Id: Iba4ad44af2e3bfde8da8ae4efdd4b132299ae9b7
This commit is contained in:
parent
3203504a28
commit
2332db20a9
1 changed files with 2 additions and 2 deletions
|
@ -85,8 +85,8 @@ LocThreadDelegate::LocThreadDelegate(LocThread::tCreate creator,
|
|||
if (mThandle) {
|
||||
// set thread name
|
||||
char lname[16];
|
||||
int len = (sizeof(lname)>sizeof(threadName)) ?
|
||||
(sizeof(threadName) -1):(sizeof(lname) - 1);
|
||||
int len = (sizeof(lname) > (strlen(threadName) + 1)) ?
|
||||
(strlen(threadName)):(sizeof(lname) - 1);
|
||||
memcpy(lname, threadName, len);
|
||||
lname[len] = 0;
|
||||
// set the thread name here
|
||||
|
|
Loading…
Reference in a new issue