lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [patch #5468] sockets.c: Create socksem and selectsem in an


From: goldsimon
Subject: [lwip-devel] [patch #5468] sockets.c: Create socksem and selectsem in an init-function
Date: Fri, 20 Oct 2006 09:59:09 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7

URL:
  <http://savannah.nongnu.org/patch/?5468>

                 Summary: sockets.c: Create socksem and selectsem in an
init-function
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: goldsimon
            Submitted on: Freitag 20.10.2006 um 09:59
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open

    _______________________________________________________

Details:

Created a new function, socket_init() which creates those semaphores. Must be
called any time at startup of the stack, but before using sockets.

See Bug #3466 for description:

All calls to sys_sem_wait() in sockets.c are introduced by

if (!...)
... = sys_sem_new(1);

except for lwip_accept(), where sys_sem_wait() could be used on non-allocated
semaphore.

(Moreover this construction is not thread-save. A task switch could occur
between the decision that the semaphore needs creation and the actual call of
sys_sem_new.)

Proposal: Allocate the semaphore only once, at lwip startup.





    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Freitag 20.10.2006 um 09:59  Name: socket_init.patch  Size: 2kB   By:
goldsimon

<http://savannah.nongnu.org/patch/download.php?file_id=11008>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?5468>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]