Revert "Fix lwip implementation of retransmission timers."
[bertos.git] / bertos / net / lwip / src / arch / sys_arch.c
index d626f0cfd09933c66d6d9c9e3462808fa95dfd5d..0d1ade5ce6a5dd77114d7f03704f40dfd25d0985 100644 (file)
@@ -317,6 +317,15 @@ static struct sys_timeouts lwip_system_timeouts; // Default timeouts list for lw
 
 struct sys_timeouts *sys_arch_timeouts(void)
 {
+       ThreadNode *thread_node;
+       struct Process *curr_pid = proc_current();
+
+       FOREACH_NODE(thread_node, &used_thread)
+       {
+               if (thread_node->pid == curr_pid)
+                       return &(thread_node->timeout);
+       }
+
        return &lwip_system_timeouts;
 }
 
@@ -360,7 +369,7 @@ sys_thread_t sys_thread_new(const char *name, void (* thread)(void *arg),
 
        #if !CONFIG_KERN_HEAP
                ASSERT(stacksize <= DEFAULT_THREAD_STACKSIZE);
-               PROC_ATOMIC(stackbase = &thread_stack[last_stack++]);
+               PROC_ATOMIC(stackbase = thread_stack[last_stack++]);
        #else
                stackbase = NULL;
        #endif