Browse Source

fixed bugs #41495 Possible threading issue in select() and #43278

event_callback() handle context switch when calling sys_sem_signal()
STABLE-2_1_x
sg 12 years ago
parent
commit
d6fbe2a5ad
  1. 4
      CHANGELOG
  2. 3
      src/api/sockets.c

4
CHANGELOG

@ -127,6 +127,10 @@ HISTORY
++ Bugfixes:
2014-10-21: Simon Goldschmidt (patch by Joel Cunningham and Albert Huitsing)
* sockts.c: fixed bugs #41495 Possible threading issue in select() and #43278
event_callback() handle context switch when calling sys_sem_signal()
2014-10-21: Simon Goldschmidt
* api_msg.c: fixed bug #38219 Assert on TCP netconn_write with sndtimeout set

3
src/api/sockets.c

@ -1387,6 +1387,8 @@ event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len)
/* At this point, SYS_ARCH is still protected! */
again:
for (scb = select_cb_list; scb != NULL; scb = scb->next) {
/* remember the state of select_cb_list to detect changes */
last_select_cb_ctr = select_cb_ctr;
if (scb->sem_signalled == 0) {
/* semaphore not signalled yet */
int do_signal = 0;
@ -1414,7 +1416,6 @@ again:
}
}
/* unlock interrupts with each step */
last_select_cb_ctr = select_cb_ctr;
SYS_ARCH_UNPROTECT(lev);
/* this makes sure interrupt protection time is short */
SYS_ARCH_PROTECT(lev);

Loading…
Cancel
Save