You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2022/10/06 08:33:41 UTC

[mynewt-core] branch master updated: kernel/os: Add t_mutex and t_sem fields

This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 760fbd79d kernel/os: Add t_mutex and t_sem fields
760fbd79d is described below

commit 760fbd79d9c6e8db048f7c4f7612e77ff9733e27
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Thu Oct 6 09:37:39 2022 +0200

    kernel/os: Add t_mutex and t_sem fields
    
    t_obj points to semaphore or mutex while task is waiting
    now t_obj is field in union along with t_mutex and t_sem
    it just makes debugging easier since IDE can show mutex
    or semaphore without need to case in GDB console
---
 kernel/os/include/os/os_task.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/kernel/os/include/os/os_task.h b/kernel/os/include/os/os_task.h
index b42f51ca2..c3e7752b4 100644
--- a/kernel/os/include/os/os_task.h
+++ b/kernel/os/include/os/os_task.h
@@ -114,7 +114,11 @@ struct os_task {
     void *t_arg;
 
     /** Current object task is waiting on, either a semaphore or mutex */
-    void *t_obj;
+    union {
+        void *t_obj;
+        struct os_mutex *t_mutex;
+        struct os_sem *t_sem;
+    };
 
     /** Default sanity check for this task */
     struct os_sanity_check t_sanity_check;