|
From: | address@hidden |
Subject: | Re: [lwip-users] Requirement that sys_thread_t is integer (or pointer)? |
Date: | Tue, 16 Nov 2021 07:57:19 +0100 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 |
Am 15.11.2021 um 18:03 schrieb Grant Edwards:
Is it required that sys_thread_t be a pointer or integer type? The documentation doesn't state that. The example implementation at https://lwip.fandom.com/wiki/Porting_for_an_OS#Threads shows it as a struct, and in the freeRTOS port it's a struct. But the test code assumes it's a pointer or integer type: 430 static void 431 sockets_stresstest_conn_client(void *arg) 432 { ... 456 if (LWIP_RAND() & 1) { 457 sys_thread_t t; ... 463 t = sys_thread_new("sockets_stresstest_conn_client_r", sockets_stresstest_conn_client_r, data, 0, 0); 464 LWIP_ASSERT("thread != NULL", t != 0);
That should probably be changed to use 'sys_thread_valid()' (which does not exist yet). The ' != 0' test is clearly not portable: any type should work. Regards, Simon
... 466 } The expression 't != 0' at line 464 is legal only if sys_thread_t is a pointer or integer type.
[Prev in Thread] | Current Thread | [Next in Thread] |