mirror of
https://github.com/apache/nuttx.git
synced 2026-06-08 01:42:58 +08:00
Add support for priority inheritance
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1581 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/********************************************************************************
|
||||
* nuttx/sched.h
|
||||
*
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -177,6 +177,9 @@ struct _TCB
|
||||
entry_t entry; /* Entry Point into the thread */
|
||||
exitfunc_t exitfunc; /* Called if exit is called. */
|
||||
ubyte sched_priority; /* Current priority of the thread */
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
ubyte base_priority; /* "Normal" priority of the thread */
|
||||
#endif
|
||||
ubyte task_state; /* Current state of the thread */
|
||||
uint16 flags; /* Misc. general status flags */
|
||||
sint16 lockcount; /* 0=preemptable (not-locked) */
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
/********************************************************************************
|
||||
* pthread.h
|
||||
*
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -155,14 +155,14 @@ typedef pthread_addr_t any_t;
|
||||
typedef pthread_addr_t (*pthread_startroutine_t)(pthread_addr_t);
|
||||
typedef pthread_startroutine_t pthread_func_t;
|
||||
|
||||
struct pthread_addr_s
|
||||
struct pthread_attr_s
|
||||
{
|
||||
size_t stacksize; /* Size of the stack allocated for the pthead */
|
||||
sint16 priority; /* Priority of the pthread */
|
||||
ubyte policy; /* Pthread scheduler policy */
|
||||
ubyte inheritsched; /* Inherit parent prio/policy? */
|
||||
};
|
||||
typedef struct pthread_addr_s pthread_attr_t;
|
||||
typedef struct pthread_attr_s pthread_attr_t;
|
||||
|
||||
typedef pid_t pthread_t;
|
||||
|
||||
|
||||
+4
-1
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* include/semaphore.h
|
||||
*
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -64,6 +64,9 @@ struct sem_s
|
||||
{
|
||||
sint16 semcount; /* >0 -> Num counts available */
|
||||
/* <0 -> Num tasks waiting for semaphore */
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
void *holder; /* Holder TCB (actual type is _TCB) */
|
||||
#endif
|
||||
};
|
||||
typedef struct sem_s sem_t;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user