Skip to content
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

core/thread: always use THREAD_CREATE_STACKTEST when DEVELHELP is enabled #20450

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions core/include/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
* ----------------------------- | --------------------------------------------------
* @ref THREAD_CREATE_SLEEPING | the thread will sleep until woken up manually
* @ref THREAD_CREATE_WOUT_YIELD | the thread might not run immediately after creation
* @ref THREAD_CREATE_STACKTEST | measures the stack's memory usage
*
* Thread creation
* ===============
Expand Down Expand Up @@ -83,7 +82,7 @@
* int main(void)
* {
* thread_create(rcv_thread_stack, sizeof(rcv_thread_stack),
* THREAD_PRIORITY_MAIN - 1, THREAD_CREATE_STACKTEST,
* THREAD_PRIORITY_MAIN - 1, 0,
* rcv_thread, NULL, "rcv_thread");
* }
* ~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -231,10 +230,11 @@ struct _thread {
#define THREAD_CREATE_WOUT_YIELD (4)

/**
* @brief Write markers into the thread's stack to measure stack usage (for
* debugging and profiling purposes)
* @brief Legacy flag kept for compatibility.
*
* This is always enabled with `DEVELHELP=1` or `SCHED_TEST_STACK`.
*/
#define THREAD_CREATE_STACKTEST (8)
#define THREAD_CREATE_STACKTEST (0)
/** @} */

/**
Expand Down Expand Up @@ -456,6 +456,7 @@ static inline const char *thread_getname(kernel_pid_t pid)
* Only works if the stack is filled with canaries
* (`*((uintptr_t *)ptr) == (uintptr_t)ptr` for naturally aligned `ptr` within
* the stack).
* This is enabled if `DEVELHELP` is set.
*
* @param[in] stack the stack you want to measure. Try
* `thread_get_stackstart(thread_get_active())`
Expand Down
4 changes: 2 additions & 2 deletions core/lib/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ void kernel_init(void)
if (IS_USED(MODULE_CORE_IDLE_THREAD)) {
thread_create(idle_stack, sizeof(idle_stack),
THREAD_PRIORITY_IDLE,
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
THREAD_CREATE_WOUT_YIELD,
idle_thread, NULL, "idle");
}

thread_create(main_stack, sizeof(main_stack),
THREAD_PRIORITY_MAIN,
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
THREAD_CREATE_WOUT_YIELD,
main_trampoline, NULL, "main");

cpu_switch_context_exit();
Expand Down
23 changes: 8 additions & 15 deletions core/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,21 +247,14 @@ kernel_pid_t thread_create(char *stack, int stacksize, uint8_t priority,

#if defined(DEVELHELP) || defined(SCHED_TEST_STACK) \
|| defined(MODULE_TEST_UTILS_PRINT_STACK_USAGE)
if (flags & THREAD_CREATE_STACKTEST) {
/* assign each int of the stack the value of it's address. Alignment
* has been handled above, so silence -Wcast-align */
uintptr_t *stackmax = (uintptr_t *)(uintptr_t)(stack + stacksize);
uintptr_t *stackp = (uintptr_t *)(uintptr_t)stack;

while (stackp < stackmax) {
*stackp = (uintptr_t)stackp;
stackp++;
}
}
else {
/* create stack guard. Alignment has been handled above, so silence
* -Wcast-align */
*(uintptr_t *)(uintptr_t)stack = (uintptr_t)stack;
/* assign each int of the stack the value of it's address. Alignment
* has been handled above, so silence -Wcast-align */
uintptr_t *stackmax = (uintptr_t *)(uintptr_t)(stack + stacksize);
uintptr_t *stackp = (uintptr_t *)(uintptr_t)stack;

while (stackp < stackmax) {
*stackp = (uintptr_t)stackp;
stackp++;
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion cpu/esp_common/freertos/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ BaseType_t xTaskCreatePinnedToCore(TaskFunction_t pvTaskCode,
usStackDepth + sizeof(thread_t),
uxPriority,
THREAD_CREATE_WOUT_YIELD |
THREAD_CREATE_STACKTEST,
0,
(void *)pvTaskCode,
pvParameters, pcName);
DEBUG("pid=%d\n", pid);
Expand Down
2 changes: 1 addition & 1 deletion examples/dtls-echo/dtls-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ static void start_server(void)
_dtls_server_pid = thread_create(_dtls_server_stack,
sizeof(_dtls_server_stack),
THREAD_PRIORITY_MAIN - 1,
THREAD_CREATE_STACKTEST,
0,
_dtls_server_wrapper, NULL, "DTLS_Server");

/* Uncommon but better be sure */
Expand Down
2 changes: 1 addition & 1 deletion examples/dtls-sock/dtls-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ static void start_server(void)
_dtls_server_pid = thread_create(_dtls_server_stack,
sizeof(_dtls_server_stack),
THREAD_PRIORITY_MAIN - 1,
THREAD_CREATE_STACKTEST,
0,
dtls_server_wrapper, NULL, "dtls_server");

/* Uncommon but better be sure */
Expand Down
2 changes: 1 addition & 1 deletion examples/ipc_pingpong/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int main(void)
msg_t m;

kernel_pid_t pid = thread_create(second_thread_stack, sizeof(second_thread_stack),
THREAD_PRIORITY_MAIN - 1, THREAD_CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 1, 0,
second_thread, NULL, "pong");

m.content.value = 1;
Expand Down
2 changes: 1 addition & 1 deletion examples/posix_sockets/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static int udp_start_server(char *port_str)
}
/* start server (which means registering pktdump for the chosen port) */
if (thread_create(server_stack, sizeof(server_stack), THREAD_PRIORITY_MAIN - 1,
THREAD_CREATE_STACKTEST,
0,
_server_thread, port_str, "UDP server") <= KERNEL_PID_UNDEF) {
server_socket = -1;
puts("error initializing thread");
Expand Down
2 changes: 1 addition & 1 deletion examples/sniffer/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ int main(void)
/* start and register rawdump thread */
puts("Run the rawdump thread and register it");
dump.target.pid = thread_create(rawdmp_stack, sizeof(rawdmp_stack), RAWDUMP_PRIO,
THREAD_CREATE_STACKTEST, rawdump, NULL, "rawdump");
0, rawdump, NULL, "rawdump");
dump.demux_ctx = GNRC_NETREG_DEMUX_CTX_ALL;
gnrc_netreg_register(GNRC_NETTYPE_UNDEF, &dump);

Expand Down
6 changes: 3 additions & 3 deletions examples/thread_duel/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,19 @@ int main(void)
{
static char stack[WORKER_STACKSIZE];
static struct worker_config wc = THREAD_1; /* 0-10 workness */
thread_create(stack, sizeof(stack), 7, THREAD_CREATE_STACKTEST,
thread_create(stack, sizeof(stack), 7, 0,
thread_worker, &wc, "T1");
}
{
static char stack[WORKER_STACKSIZE];
static struct worker_config wc = THREAD_2; /* 0-10 workness */
thread_create(stack, sizeof(stack), 7, THREAD_CREATE_STACKTEST,
thread_create(stack, sizeof(stack), 7, 0,
thread_worker, &wc, "T2");
}
{
static char stack[WORKER_STACKSIZE];
static struct worker_config wc = THREAD_3; /* 0-10 workness */
thread_create(stack, sizeof(stack), 7, THREAD_CREATE_STACKTEST,
thread_create(stack, sizeof(stack), 7, 0,
thread_worker, &wc, "T3");
}
}
2 changes: 1 addition & 1 deletion pkg/lwip/contrib/netdev/lwip_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ err_t lwip_netdev_init(struct netif *netif)
/* start multiplexing thread (only one needed) */
if (_pid <= KERNEL_PID_UNDEF) {
_pid = thread_create(_stack, LWIP_NETDEV_STACKSIZE, LWIP_NETDEV_PRIO,
THREAD_CREATE_STACKTEST, _event_loop, netif,
0, _event_loop, netif,
LWIP_NETDEV_NAME);
if (_pid <= 0) {
return ERR_IF;
Expand Down
2 changes: 1 addition & 1 deletion pkg/lwip/contrib/sys_arch.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread, void *arg,
if (stack == NULL) {
return ERR_MEM;
}
if ((res = thread_create(stack, stacksize, prio, THREAD_CREATE_STACKTEST,
if ((res = thread_create(stack, stacksize, prio, 0,
_lwip_thread_wrapper, &params,
name)) <= KERNEL_PID_UNDEF) {
abort();
Expand Down
2 changes: 1 addition & 1 deletion pkg/mynewt-core/contrib/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int os_task_init(struct os_task *t, const char *name, os_task_func_t func,
LOG_DEBUG("[mynewt-core]: starting thread %s\n", name);

kernel_pid_t pid = thread_create(stack_bottom, (int) stack_size,
prio, THREAD_CREATE_STACKTEST,
prio, 0,
func, arg, name);

t->pid = pid;
Expand Down
4 changes: 2 additions & 2 deletions pkg/nimble/contrib/nimble_riot.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static void *_host_thread(void *arg)
*/
thread_create(_stack_controller, sizeof(_stack_controller),
NIMBLE_CONTROLLER_PRIO,
THREAD_CREATE_STACKTEST,
0,
(thread_task_func_t)nimble_port_ll_task_func, NULL,
"nimble_ctrl");

Expand Down Expand Up @@ -133,7 +133,7 @@ void nimble_riot_init(void)
/* and finally initialize and run the host */
thread_create(_stack_host, sizeof(_stack_host),
NIMBLE_HOST_PRIO,
THREAD_CREATE_STACKTEST,
0,
_host_thread, NULL,
"nimble_host");

Expand Down
2 changes: 1 addition & 1 deletion pkg/openthread/contrib/netdev/openthread_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static void *_openthread_event_loop(void *arg)
int openthread_netdev_init(char *stack, int stacksize, char priority,
const char *name, netdev_t *netdev) {
if (thread_create(stack, stacksize,
priority, THREAD_CREATE_STACKTEST,
priority, 0,
_openthread_event_loop, netdev, name) < 0) {
return -EINVAL;
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/openwsn/contrib/openwsn.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int openwsn_bootstrap(void)

LOG_DEBUG("[openwsn]: network thread\n");
_pid = thread_create(_stack, OPENWSN_SCHED_STACKSIZE, OPENWSN_SCHED_PRIO,
THREAD_CREATE_STACKTEST, _event_loop, NULL,
0, _event_loop, NULL,
OPENWSN_SCHED_NAME);
if (_pid <= 0) {
LOG_ERROR("[openwsn]: couldn't create thread\n");
Expand Down
2 changes: 1 addition & 1 deletion pkg/paho-mqtt/contrib/riot_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@

int TimerLeftMS(Timer *timer)
{
uint32_t left_time = ztimer_now(ZTIMER_MSEC) - timer->time_set; /* should be always greater than 0 */

Check warning on line 180 in pkg/paho-mqtt/contrib/riot_iface.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
if (left_time < timer->timeout) {
left_time = timer->timeout - left_time;
return left_time;
Expand Down Expand Up @@ -225,7 +225,7 @@
(void) fn;
thread->pid = thread_create(thread->stack, sizeof(thread->stack),
MQTT_THREAD_PRIORITY,
THREAD_CREATE_STACKTEST, mqtt_riot_run, arg,
0, mqtt_riot_run, arg,
"paho_mqtt_riot");
return thread->pid;
}
2 changes: 1 addition & 1 deletion pkg/semtech-loramac/contrib/semtech_loramac.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@
mlmeReq.Req.Join.Datarate = dr;
mutex_unlock(&mac->lock);
uint8_t ret = LoRaMacMlmeRequest(&mlmeReq);
switch(ret) {

Check warning on line 413 in pkg/semtech-loramac/contrib/semtech_loramac.c

View workflow job for this annotation

GitHub Actions / static-tests

keyword 'switch' not followed by a single space
case LORAMAC_STATUS_OK:
/* Let the MAC do his job */
return;
Expand Down Expand Up @@ -550,7 +550,7 @@
semtech_loramac_radio_events.RxDone(radio_payload,
len, packet_info.rssi,
packet_info.snr);
} /* len could be -EBADMSG, in which case a CRC error message will be received shortly */

Check warning on line 553 in pkg/semtech-loramac/contrib/semtech_loramac.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
break;
}
case NETDEV_EVENT_RX_TIMEOUT:
Expand All @@ -568,7 +568,7 @@
#if IS_USED(MODULE_SX127X)
case NETDEV_EVENT_FHSS_CHANGE_CHANNEL:
DEBUG("[semtech-loramac] FHSS channel change\n");
if(semtech_loramac_radio_events.FhssChangeChannel) {

Check warning on line 571 in pkg/semtech-loramac/contrib/semtech_loramac.c

View workflow job for this annotation

GitHub Actions / static-tests

keyword 'if' not followed by a single space
sx127x_t *sx127x = container_of(dev, sx127x_t, netdev);
semtech_loramac_radio_events.FhssChangeChannel(
sx127x->_internal.last_channel);
Expand All @@ -578,7 +578,7 @@
case NETDEV_EVENT_CAD_DONE:
DEBUG("[semtech-loramac] test: CAD done\n");
sx127x_t *sx127x = container_of(dev, sx127x_t, netdev);
if(semtech_loramac_radio_events.CadDone) {

Check warning on line 581 in pkg/semtech-loramac/contrib/semtech_loramac.c

View workflow job for this annotation

GitHub Actions / static-tests

keyword 'if' not followed by a single space
semtech_loramac_radio_events.CadDone(
sx127x->_internal.is_last_cad_success);
}
Expand Down Expand Up @@ -834,7 +834,7 @@
semtech_loramac_pid = thread_create(_semtech_loramac_stack,
sizeof(_semtech_loramac_stack),
THREAD_PRIORITY_MAIN - 1,
THREAD_CREATE_STACKTEST,
0,
_semtech_loramac_event_loop, mac,
"recv_thread");

Expand Down
4 changes: 2 additions & 2 deletions pkg/tinyusb/contrib/tinyusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ int tinyusb_setup(void)
sizeof(_tinyusb_thread_stack),
TINYUSB_PRIORITY,
#if MODULE_RIOTBOOT_TINYUSB_DFU
THREAD_CREATE_STACKTEST,
0,
#else
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
THREAD_CREATE_WOUT_YIELD,
#endif
_tinyusb_thread_impl, NULL, "tinyusb")) < 0) {
LOG_ERROR("tinyUSB thread couldn't be created, reason %d\n", res);
Expand Down
2 changes: 1 addition & 1 deletion pkg/uwb-core/contrib/uwb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void uwb_core_riot_init(void)
#if !IS_USED(MODULE_UWB_CORE_EVENT_THREAD)
thread_create(_stack_uwb_core, sizeof(_stack_uwb_core),
UWB_CORE_PRIO,
THREAD_CREATE_STACKTEST,
0,
_uwb_core_thread, NULL,
"uwb_core_event");
#endif
Expand Down
2 changes: 1 addition & 1 deletion sys/auto_init/wdt_thread/wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static void *_wdt_thread(void *ctx)
static void auto_init_wdt_thread(void)
{
thread_create(wdt_stack, sizeof(wdt_stack), THREAD_PRIORITY_MIN,
THREAD_CREATE_STACKTEST, _wdt_thread, NULL, "watchdog");
0, _wdt_thread, NULL, "watchdog");
}

AUTO_INIT(auto_init_wdt_thread, AUTO_INIT_PRIO_WDT_THREAD);
2 changes: 1 addition & 1 deletion sys/can/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
}

if (candev_dev->last_pm_update == 0 ||
value > (candev_dev->last_pm_value - (ztimer_now(ZTIMER_USEC) - candev_dev->last_pm_update))) {

Check warning on line 180 in sys/can/device.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
candev_dev->last_pm_value = value;
candev_dev->last_pm_update = ztimer_now(ZTIMER_USEC);
ztimer_set(ZTIMER_USEC, &candev_dev->pm_timer, value);
Expand Down Expand Up @@ -364,7 +364,7 @@
}

/* create new can device thread */
res = thread_create(stack, stacksize, priority, THREAD_CREATE_STACKTEST,
res = thread_create(stack, stacksize, priority, 0,
_can_device_thread, (void *)params, name);
if (res <= 0) {
return -EINVAL;
Expand Down Expand Up @@ -407,7 +407,7 @@
* @return the computed sample point from @p tseg1 and @p tseg2
*/
static uint32_t update_sample_point(const struct can_bittiming_const *btc, uint32_t spt_nominal,
uint32_t tseg, uint32_t *p_tseg1, uint32_t *p_tseg2, uint32_t *p_spt_error)

Check warning on line 410 in sys/can/device.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
{
uint32_t best_spt = 0;
uint32_t min_spt_error = UINT32_MAX;
Expand Down Expand Up @@ -520,7 +520,7 @@
uint32_t rate = clock / (brp * nbt);
rate_error = max(timing->bitrate, rate) - min(timing->bitrate, rate);
if (rate_error > min_rate_error) {
DEBUG("timing->rate=%" PRIu32 ", rate=%" PRIu32 ", rate_error=%" PRIu32 " > min_rate_error=%" PRIu32 ", continuing\n",

Check warning on line 523 in sys/can/device.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
timing->bitrate, rate, rate_error, min_rate_error);
continue;
}
Expand Down Expand Up @@ -548,7 +548,7 @@
}
}

DEBUG("computed values: min_rate_error=%" PRIu32 ", min_spt_error=%" PRIu32 "\n", min_rate_error, min_spt_error);

Check warning on line 551 in sys/can/device.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters

if (min_rate_error) {
rate_error = min_rate_error * 1000 / timing->bitrate;
Expand Down Expand Up @@ -581,7 +581,7 @@
timing->bitrate = clock / (timing->brp * (CAN_SYNC_SEG + tseg1 + tseg2));

DEBUG("bitrate=%" PRIu32 ", sample_point=%" PRIu32 ", brp=%" PRIu32 ", prop_seg=%" PRIu32
", phase_seg1=%" PRIu32 ", phase_seg2=%" PRIu32 "\n", timing->bitrate, timing->sample_point,

Check warning on line 584 in sys/can/device.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
timing->brp, timing->prop_seg, timing->phase_seg1, timing->phase_seg2);

return 0;
Expand Down
2 changes: 1 addition & 1 deletion sys/can/isotp/isotp.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ kernel_pid_t isotp_init(char *stack, int stacksize, char priority, const char *n
DEBUG("isotp_init\n");

/* create new can device thread */
res = thread_create(stack, stacksize, priority, THREAD_CREATE_STACKTEST,
res = thread_create(stack, stacksize, priority, 0,
_isotp_thread, NULL, name);
if (res <= 0) {
return -EINVAL;
Expand Down
2 changes: 1 addition & 1 deletion sys/event/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void event_thread_init_multi(event_queue_t *queues, size_t queues_numof,

void *tagged_ptr = ptrtag(queues, queues_numof - 1);

thread_create(stack, stack_size, priority, THREAD_CREATE_STACKTEST,
thread_create(stack, stack_size, priority, 0,
_handler_thread, tagged_ptr, "event");
}

Expand Down
2 changes: 1 addition & 1 deletion sys/fido2/ctap/transport/ctap_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void fido2_ctap_transport_init(void)
#endif

int ret = thread_create(_ctap_stack, sizeof(_ctap_stack), CTAP_TRANSPORT_PRIO,
THREAD_CREATE_STACKTEST, _event_loop, NULL,
0, _event_loop, NULL,
"fido2_ctap_transport_loop");

(void)ret;
Expand Down
2 changes: 1 addition & 1 deletion sys/net/application_layer/asymcute/asymcute.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ void _on_pkt(sock_udp_t *sock, sock_async_flags_t type, void *arg)
void asymcute_handler_run(void)
{
thread_create(_stack, sizeof(_stack), ASYMCUTE_HANDLER_PRIO,
THREAD_CREATE_STACKTEST, _eventloop, NULL, "asymcute_main");
0, _eventloop, NULL, "asymcute_main");
}

int asymcute_topic_init(asymcute_topic_t *topic, const char *topic_name,
Expand Down
2 changes: 1 addition & 1 deletion sys/net/application_layer/cord/ep/cord_ep_standalone.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static void *_reg_runner(void *arg)

void cord_ep_standalone_run(void)
{
thread_create(_stack, sizeof(_stack), PRIO, THREAD_CREATE_STACKTEST,
thread_create(_stack, sizeof(_stack), PRIO, 0,
_reg_runner, NULL, TNAME);
}

Expand Down
2 changes: 1 addition & 1 deletion sys/net/application_layer/dhcpv6/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void dhcpv6_client_auto_init(void)
if (_thread_pid <= 0) {
_thread_pid = thread_create(_thread_stack, DHCPV6_CLIENT_STACK_SIZE,
DHCPV6_CLIENT_PRIORITY,
THREAD_CREATE_STACKTEST,
0,
_thread, NULL, "dhcpv6-client");
}
}
Expand Down
2 changes: 1 addition & 1 deletion sys/net/application_layer/dhcpv6/relay.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void dhcpv6_relay_auto_init(void)
}
else {
thread_create(_auto_init_stack, ARRAY_SIZE(_auto_init_stack),
AUTO_INIT_PRIO, THREAD_CREATE_STACKTEST,
AUTO_INIT_PRIO, 0,
_dhcpv6_relay_auto_init_thread,
(void *)(intptr_t)netif, "dhcpv6_relay");
}
Expand Down
2 changes: 1 addition & 1 deletion sys/net/application_layer/gcoap/gcoap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ kernel_pid_t gcoap_init(void)
return -EEXIST;
}
_pid = thread_create(_msg_stack, sizeof(_msg_stack), THREAD_PRIORITY_MAIN - 1,
THREAD_CREATE_STACKTEST, _event_loop, NULL, "coap");
0, _event_loop, NULL, "coap");

mutex_init(&_coap_state.lock);
/* Blank lists so we know if an entry is available. */
Expand Down
2 changes: 1 addition & 1 deletion sys/net/application_layer/nanocoap/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ kernel_pid_t nanocoap_server_start(const sock_udp_ep_t *local)
return _coap_server_pid;
}
_coap_server_pid = thread_create(stack, sizeof(stack), THREAD_PRIORITY_MAIN - 1,
THREAD_CREATE_STACKTEST, _nanocoap_server_thread,
0, _nanocoap_server_thread,
(void *)local, "nanoCoAP server");
return _coap_server_pid;
}
Expand Down
2 changes: 1 addition & 1 deletion sys/net/application_layer/telnet/telnet_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ int telnet_server_start(void)

/* initiate telnet server */
thread_create(telnet_stack, sizeof(telnet_stack),
THREAD_PRIORITY_MAIN - 1, THREAD_CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 1, 0,
telnet_thread, NULL, "telnet");

return 0;
Expand Down
2 changes: 1 addition & 1 deletion sys/net/gnrc/application_layer/dhcpv6/client_simple_pd.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void gnrc_dhcpv6_client_simple_pd_init(void)
/* start DHCPv6 client thread to request prefix for WPAN */
thread_create(_stack, DHCPV6_CLIENT_STACK_SIZE,
DHCPV6_CLIENT_PRIORITY,
THREAD_CREATE_STACKTEST,
0,
_dhcpv6_cl_simple_pd_thread, NULL, "dhcpv6-client");
}

Expand Down
2 changes: 1 addition & 1 deletion sys/net/gnrc/application_layer/uhcpc/gnrc_uhcpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,6 @@ void auto_init_gnrc_uhcpc(void)

/* initiate uhcp client */
thread_create(_uhcp_client_stack, sizeof(_uhcp_client_stack),
THREAD_PRIORITY_MAIN - 1, THREAD_CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 1, 0,
uhcp_client_thread, NULL, "uhcp");
}
2 changes: 1 addition & 1 deletion sys/net/gnrc/netif/gnrc_netif.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ int gnrc_netif_create(gnrc_netif_t *netif, char *stack, int stacksize,
mutex_init(&ctx.init_done);
mutex_lock(&ctx.init_done);

res = thread_create(stack, stacksize, priority, THREAD_CREATE_STACKTEST,
res = thread_create(stack, stacksize, priority, 0,
_gnrc_netif_thread, &ctx, name);
assert(res > 0);
(void)res;
Expand Down