Skip to content

Add names to system thread #8612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions events/mbed_shared_queues.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ namespace mbed {
*/
template
<osPriority Priority, size_t QueueSize, size_t StackSize>
EventQueue *do_shared_event_queue_with_thread()
EventQueue *do_shared_event_queue_with_thread(const char *name)
{
static uint64_t queue_buffer[QueueSize / sizeof(uint64_t)];
static EventQueue queue(sizeof queue_buffer, (unsigned char *) queue_buffer);

static uint64_t stack[StackSize / sizeof(uint64_t)];
static Thread thread(Priority, StackSize, (unsigned char *) stack);
static Thread thread(Priority, StackSize, (unsigned char *) stack, name);

Thread::State state = thread.get_state();
if (state == Thread::Inactive || state == Thread::Deleted) {
Expand All @@ -62,14 +62,14 @@ EventQueue *mbed_event_queue()

return &queue;
#else
return do_shared_event_queue_with_thread<osPriorityNormal, MBED_CONF_EVENTS_SHARED_EVENTSIZE, MBED_CONF_EVENTS_SHARED_STACKSIZE>();
return do_shared_event_queue_with_thread<osPriorityNormal, MBED_CONF_EVENTS_SHARED_EVENTSIZE, MBED_CONF_EVENTS_SHARED_STACKSIZE>("shared_event_queue");
#endif
}

#ifdef MBED_CONF_RTOS_PRESENT
EventQueue *mbed_highprio_event_queue()
{
return do_shared_event_queue_with_thread<osPriorityHigh, MBED_CONF_EVENTS_SHARED_HIGHPRIO_EVENTSIZE, MBED_CONF_EVENTS_SHARED_HIGHPRIO_STACKSIZE>();
return do_shared_event_queue_with_thread<osPriorityHigh, MBED_CONF_EVENTS_SHARED_HIGHPRIO_EVENTSIZE, MBED_CONF_EVENTS_SHARED_HIGHPRIO_STACKSIZE>("shared_highprio_event_queue");
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion features/cellular/easy_cellular/CellularConnectionFSM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ nsapi_error_t CellularConnectionFSM::start_dispatch()
{
MBED_ASSERT(!_queue_thread);

_queue_thread = new rtos::Thread(osPriorityNormal, 2048);
_queue_thread = new rtos::Thread(osPriorityNormal, 2048, NULL, "cellular_fsm");
if (!_queue_thread) {
stop();
return NSAPI_ERROR_NO_MEMORY;
Expand Down
2 changes: 1 addition & 1 deletion features/lwipstack/lwip/src/include/lwip/opt.h
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,7 @@
* TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.
*/
#if !defined TCPIP_THREAD_NAME || defined __DOXYGEN__
#define TCPIP_THREAD_NAME "tcpip_thread"
#define TCPIP_THREAD_NAME "lwip_tcpip"
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion features/lwipstack/ppp_lwip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static EventQueue *prepare_event_queue()

// Only need to queue 2 events. new blows on failure.
event_queue = new EventQueue(2 * EVENTS_EVENT_SIZE, NULL);
event_thread = new Thread(osPriorityNormal, PPP_THREAD_STACK_SIZE);
event_thread = new Thread(osPriorityNormal, PPP_THREAD_STACK_SIZE, NULL, "ppp_lwip");

if (event_thread->start(callback(event_queue, &EventQueue::dispatch_forever)) != osOK) {
delete event_thread;
Expand Down
2 changes: 1 addition & 1 deletion rtos/TARGET_CORTEX/mbed_rtos_rtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ MBED_NORETURN void mbed_rtos_start()
_main_thread_attr.cb_size = sizeof(_main_obj);
_main_thread_attr.cb_mem = &_main_obj;
_main_thread_attr.priority = osPriorityNormal;
_main_thread_attr.name = "main_thread";
_main_thread_attr.name = "main";

/* Allow non-secure main thread to call secure functions */
#if defined(DOMAIN_NS) && (DOMAIN_NS == 1U)
Expand Down
4 changes: 2 additions & 2 deletions rtos/TARGET_CORTEX/mbed_rtx_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
// LIBSPACE default value set for ARMCC
#define OS_THREAD_LIBSPACE_NUM 4

#define OS_IDLE_THREAD_NAME "idle_thread"
#define OS_TIMER_THREAD_NAME "timer_thread"
#define OS_IDLE_THREAD_NAME "rtx_idle"
#define OS_TIMER_THREAD_NAME "rtx_timer"

/* Enable only the evr events we use in Mbed-OS to save flash space. */
//Following events are used by Mbed-OS, DO NOT disable them
Expand Down