Skip to content

Commit

Permalink
treewide: remove THREAD_CREATE_STACKTEST from thread creation
Browse files Browse the repository at this point in the history
  • Loading branch information
benpicco committed Jul 29, 2024
1 parent b1d3825 commit 312a550
Show file tree
Hide file tree
Showing 109 changed files with 160 additions and 162 deletions.
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
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 @@ -225,7 +225,7 @@ int ThreadStart(Thread *thread, void (*fn)(void *), void *arg)
(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 @@ -834,7 +834,7 @@ int semtech_loramac_init(semtech_loramac_t *mac)
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 @@ -364,7 +364,7 @@ kernel_pid_t can_device_init(char *stack, int stacksize, char priority,
}

/* 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
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 @@ -1497,7 +1497,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 @@ -1024,7 +1024,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
2 changes: 1 addition & 1 deletion sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ kernel_pid_t gnrc_ipv6_init(void)
{
if (gnrc_ipv6_pid == KERNEL_PID_UNDEF) {
gnrc_ipv6_pid = thread_create(_stack, sizeof(_stack), GNRC_IPV6_PRIO,
THREAD_CREATE_STACKTEST,
0,
_event_loop, NULL, "ipv6");
}

Expand Down
2 changes: 1 addition & 1 deletion sys/net/gnrc/network_layer/sixlowpan/gnrc_sixlowpan.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ kernel_pid_t gnrc_sixlowpan_init(void)
}

_pid = thread_create(_stack, sizeof(_stack), GNRC_SIXLOWPAN_PRIO,
THREAD_CREATE_STACKTEST, _event_loop, NULL, "6lo");
0, _event_loop, NULL, "6lo");

return _pid;
}
Expand Down
2 changes: 1 addition & 1 deletion sys/net/gnrc/pktdump/gnrc_pktdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ kernel_pid_t gnrc_pktdump_init(void)
{
if (gnrc_pktdump_pid == KERNEL_PID_UNDEF) {
gnrc_pktdump_pid = thread_create(_stack, sizeof(_stack), GNRC_PKTDUMP_PRIO,
THREAD_CREATE_STACKTEST,
0,
_eventloop, NULL, "pktdump");
}
return gnrc_pktdump_pid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ void gnrc_ipv6_auto_subnets_init(void)
{
/* initiate auto_subnets thread */
_server_pid = thread_create(auto_subnets_stack, sizeof(auto_subnets_stack),
THREAD_PRIORITY_MAIN - 1, THREAD_CREATE_STACKTEST,
THREAD_PRIORITY_MAIN - 1, 0,
_eventloop, NULL, "auto_subnets");
}
#endif /* !IS_USED(MODULE_GNRC_IPV6_AUTO_SUBNETS_SIMPLE) */
Expand Down
2 changes: 1 addition & 1 deletion sys/net/gnrc/routing/rpl/gnrc_rpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ kernel_pid_t gnrc_rpl_init(kernel_pid_t if_pid)
_instance_id = 0;
/* start the event loop */
gnrc_rpl_pid = thread_create(_stack, sizeof(_stack), GNRC_RPL_PRIO,
THREAD_CREATE_STACKTEST,
0,
_event_loop, (void*)&eventloop_startup,
"RPL");

Expand Down
2 changes: 1 addition & 1 deletion sys/net/gnrc/transport_layer/tcp/gnrc_tcp_eventloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ int _gnrc_tcp_eventloop_init(void)
evtimer_init_msg(&_tcp_msg_timer);

kernel_pid_t pid = thread_create(_stack, sizeof(_stack), TCP_EVENTLOOP_PRIO,
THREAD_CREATE_STACKTEST, _eventloop, NULL,
0, _eventloop, NULL,
"gnrc_tcp");
TCP_DEBUG_LEAVE;
return pid;
Expand Down
2 changes: 1 addition & 1 deletion sys/net/gnrc/transport_layer/udp/gnrc_udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ int gnrc_udp_init(void)
if (_pid == KERNEL_PID_UNDEF) {
/* start UDP thread */
_pid = thread_create(_stack, sizeof(_stack), GNRC_UDP_PRIO,
THREAD_CREATE_STACKTEST, _event_loop, NULL, "udp");
0, _event_loop, NULL, "udp");
}
return _pid;
}
Loading

0 comments on commit 312a550

Please sign in to comment.