-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removing GetThreadDescription from PAL API
- Loading branch information
Showing
6 changed files
with
53 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/pthread_helpers.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
#include <stdlib.h> | ||
#include <pthread.h> | ||
|
||
#define NAMELEN 256 | ||
char* GetThreadName() | ||
{ | ||
char* threadName = (char*)malloc(sizeof(char) * NAMELEN); | ||
pthread_t thread = pthread_self(); | ||
int rc = pthread_getname_np(thread, threadName, NAMELEN); | ||
if (rc != 0) | ||
{ | ||
free(threadName); | ||
return NULL; | ||
} | ||
|
||
return threadName; | ||
} |
4 changes: 4 additions & 0 deletions
4
src/coreclr/pal/tests/palsuite/threading/SetThreadDescription/test1/pthread_helpers.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
char* GetThreadName(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters