lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] unix sys_arch


From: James Roth
Subject: [lwip-users] Re: [lwip] unix sys_arch
Date: Thu, 09 Jan 2003 01:12:39 -0000

This is a multi-part message in MIME format.
--------------3D86FA4168DA673E823A3B1E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

James Roth wrote:

My previous sys_arch.c post had an error.  The attached diff is for my
posted sys_arch.c, not the official one.

> 
> Here's a modified sys_arch.c for unix.
> 
> /*
>  * Wed Apr 17 16:05:29 EDT 2002
>  *
>  *  - Fixed an unlikely sys_thread_new() race condition.
>  *
>  *  - Made current_thread() work with threads which where
>  *    not created with sys_thread_new().  This includes
>  *    the main thread and threads made with pthread_create().
>  *
>  *  - Catch overflows where more than SYS_MBOX_SIZE messages
>  *    are waiting to be read.  The sys_mbox_post() routine
>  *    will block until there is more room instead of just
>  *    leaking messages.
>  */
> 
> --
> James Roth
> Shugyo Design Technologies
> http://www.shugyodesign.com/
> 
>   ------------------------------------------------------------------------
>                     Name: sys_arch.c.gz
>    sys_arch.c.gz    Type: unspecified type (application/octet-stream)
>                 Encoding: base64
--------------3D86FA4168DA673E823A3B1E
Content-Type: text/plain; charset=us-ascii;
 name="sys_arch.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="sys_arch.diff"

*** sys_arch.c  Wed Apr 17 22:31:40 2002
--- sys_arch.c.new      Wed Apr 17 22:32:55 2002
***************
*** 166,170 ****
      int code;
      pthread_t tmp;
!     struct sys_thread *st;
  
      code = pthread_create (&tmp,
--- 166,170 ----
      int code;
      pthread_t tmp;
!     struct sys_thread *st = NULL;
  
      code = pthread_create (&tmp,
***************
*** 174,180 ****
                           arg);
  
!     st = current_thread ();
  
!     if (NULL == st || code != 0)
      {
          DEBUGF (SYS_DEBUG, ("sys_thread_new: pthread_create %d, st = 0x%x",
--- 174,183 ----
                           arg);
  
!     if (0 == code)
!     {
!         st = introduce_thread (tmp);
!     }
  
!     if (NULL == st)
      {
          DEBUGF (SYS_DEBUG, ("sys_thread_new: pthread_create %d, st = 0x%x",

--------------3D86FA4168DA673E823A3B1E--

[This message was sent through the lwip discussion list.]




reply via email to

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