#17 add size for _thread_init()

pending
2
2014-10-27
2011-12-31
wild-boar
No

I attached a patch to pass a size variable into _thread_init(). It is against trunk.

ChibiOS has the very powerful macros THREAD_EXT* which can be used to modify the code in very useful ways. My use case is to add the ability to monitor the used thread stack size. I needed the ability to access size within THREAD_EXT_INIT_HOOK.

Thanks!

Discussion

  • wild-boar
    wild-boar
    2011-12-31

    patch

     
    Attachments
  • wild-boar
    wild-boar
    2012-05-05

    patch update

     
    Attachments
  • wild-boar
    wild-boar
    2012-05-05

    I updated the patch to remove one compiler warning. It is against the latest trunk.

     
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     I attached a patch to pass a size variable into \_thread\_init\(\). It is against trunk.
    
     ChibiOS has the very powerful macros THREAD\_EXT\* which can be used to modify the code in very useful ways. My use case is to add the ability to monitor the used thread stack size. I needed the ability to access size within THREAD\_EXT\_INIT\_HOOK. 
    
    • status: open --> pending
    • assigned_to: Giovanni Di Sirio
    • Group: --> Next_Release_(example)
    • Priority: 5 --> 2
     
  • Hi,

    The problem with the patch is that the size is not available for the main thread. I am considering doing this in 3.0 but there is no easy workaround.

    Giovanni