Use SYS_ARCH_SET macro at appropriate places

Use SYS_ARCH_SET to simplify the code a bit.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
Axel Lin
2015-11-30 22:22:28 +08:00
committed by Dirk Ziegelmeier
parent fb6d0f9006
commit bd4c4b5959
3 changed files with 4 additions and 17 deletions

View File

@@ -460,7 +460,6 @@ static void
free_socket(struct lwip_sock *sock, int is_tcp)
{
void *lastdata;
SYS_ARCH_DECL_PROTECT(lev);
lastdata = sock->lastdata;
sock->lastdata = NULL;
@@ -468,9 +467,7 @@ free_socket(struct lwip_sock *sock, int is_tcp)
sock->err = 0;
/* Protect socket array */
SYS_ARCH_PROTECT(lev);
sock->conn = NULL;
SYS_ARCH_UNPROTECT(lev);
SYS_ARCH_SET(sock->conn, NULL);
/* don't use 'sock' after this line, as another task might have allocated it */
if (lastdata != NULL) {