csp_thread: posix: Replace thread_create in csp_if_udp.c
csp_if_udp.c is already posix specific.  Replace the wrapper function
with native pthread_create.
@@ -106,6 +106,9 @@ void * csp_if_udp_rx_loop(void * param) {
void csp_if_udp_init(csp_iface_t * iface, csp_if_udp_conf_t * ifconf) {
+ pthread_attr_t attributes;
+ int ret;
+
iface->driver_data = ifconf;
if (inet_aton(ifconf->host, &ifconf->peer_addr.sin_addr) == 0) {
@@ -115,7 +118,15 @@ void csp_if_udp_init(csp_iface_t * iface, csp_if_udp_conf_t * ifconf) {
printf("UDP peer address: %s:%d (listening on port %d)\n", inet_ntoa(ifconf->peer_addr.sin_addr), ifconf->rport, ifconf->lport);
/* Start server thread */
- int ret = csp_posix_thread_create(csp_if_udp_rx_loop, "UDPS", 10000, iface, 0, &ifconf->server_handle);
+ ret = pthread_attr_init(&attributes);
+ if (ret != 0) {
+ csp_log_error("csp_if_udp_init: pthread_attr_init failed: %s: %d\n", strerror(ret), ret);
+ }
+ ret = pthread_attr_setdetachstate(&attributes, PTHREAD_CREATE_DETACHED);
+ if (ret != 0) {
+ csp_log_error("csp_if_udp_init: pthread_attr_setdetachstate failed: %s: %d\n", strerror(ret), ret);
+ }
+ ret = pthread_create(&ifconf->server_handle, &attributes, csp_if_udp_rx_loop, iface);
csp_log_info("csp_if_udp_rx_loop start %d\r\n", ret);
/* MTU is datasize */
