[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #26121] Ability to retain per-thread socket error
From: |
Zhenwei Chu |
Subject: |
[lwip-devel] [bug #26121] Ability to retain per-thread socket error |
Date: |
Wed, 08 Apr 2009 20:00:00 +0000 |
User-agent: |
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB5; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; OfficeLiveConnector.1.3; OfficeLivePatch.0.0) |
URL:
<http://savannah.nongnu.org/bugs/?26121>
Summary: Ability to retain per-thread socket error
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: blackfin
Submitted on: Wed 08 Apr 2009 07:59:59 PM GMT
Category: None
Severity: 3 - Normal
Item Group: Change Request
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release:
lwIP version: 1.3.0
_______________________________________________________
Details:
In a multi-threaded lwIP application multiple threads can issue high level
socket API calls. By default global errno is used to save the last error. Some
operating systems allow thread local storage that is thread specific which can
be used to store the error values. We have extended the sock_set_errno(sk,e)
macro to set the thread specific error as below. The new
set_thread_sock_err(e) sets the socket error in the thread local storage.
Files Changed:
In api\sockets.c, line 158
From:
#define sock_set_errno(sk, e) do { \
sk->err = (e); \
set_errno(sk->err); \
} while (0)
To:
void set_thread_sock_err(int);
#define sock_set_errno(sk, e) do { \
sk->err = (e); \
set_errno(sk->err); \
set_thread_sock_err(e);\
} while (0)
#ifndef ERRNO /* NOT ERRNO */
// For multithreaded environments error is set per thread.
void set_thread_sock_err(int err)
{
ker_set_lasterror(err);
}
#endif
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?26121>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #26121] Ability to retain per-thread socket error,
Zhenwei Chu <=