Commit Graph

29 Commits

Author SHA1 Message Date
Zeng Zhaoxiu 5bf7c185af semphore: release all semphores' holder that the task held when exit
Add a list in TCB to track all semphores the task held, so we
can release all holders when exit, so nxsched_verify_tcb
is unnecessary.

Signed-off-by: Zeng Zhaoxiu <walker.zeng@transtekcorp.com>
2022-02-13 03:20:51 +08:00
Xiang Xiao 001e7c3e76 sched: Don't include nuttx/sched.h inside sched.h
But let nuttx/sched.h include sched.h instead to
avoid expose nuttx kernel API to userspace.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-05-24 12:11:53 +09:00
Alin Jerpelea 9b9be7e1f0 include: Author: Gregory Nutt: update licenses to Apache 2.0
Update files from Gregory Nutt to Apache 2.0 license.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-04 03:33:58 -08:00
Xiang Xiao 33ec242caf Implement proposed POSIX _clockwait variants of existing _timedwait functions
Here is the related glibc patchset:
https://patchwork.ozlabs.org/project/glibc/cover/cover.b0c66849a87ca79889a49f2f1f2563b1a8a15d8b.1551291557.git-series.mac@mcrowe.com/

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I0095cb34cef3d0d88a100255053da79266b73ff2
2020-07-27 20:39:59 -03:00
Gregory Nutt e7ce9c4a79 sem_open() should return SEM_FAILED on any failures. This is change change in the POSIX specification since the original sem_open() was written so many years ago. 2017-09-08 10:14:51 -06:00
Gregory Nutt 3fb0a00c35 Small changes from review of last PR. Plus spacing and typo fix. 2017-03-22 17:32:52 -06:00
David Sidrane 60d8606b19 Priority Inversion fixes:Initalization 2017-03-10 06:38:17 -10:00
Gregory Nutt 360539afac Priority inheritance: When CONFIG_SEM_PREALLOCHOLDERS==0, there is only a single, hard-allocated holder structure. This is problem because in sem_wait() the holder is released, but needs to remain in the holder container until sem_restorebaseprio() is called. The call to sem_restorebaseprio() must be one of the last things the sem_wait() does because it can cause the task to be suspended. If in sem_wait(), a new task gets the semaphore count then it will fail to allocate the holder and will not participate in priority inheritance. This fix is to add two hard-allocated holders in the sem_t structure: One of the old holder and one for the new holder. 2017-03-10 09:30:15 -06:00
Gregory Nutt 97bf82ee05 Semaphores: Provide macros for sem_setprotobol() and sem_getprotocol() if priority inheritance is not enabled. More SEM_PRIO_* definitions to include/nuttx/semaphore.h 2016-11-02 18:21:46 -06:00
Gregory Nutt d5b4d848d3 Move protoypes for the non-standard include/semaphore.h file to the non-standard include/nuttx/semaphore.h with the other non-standard semaphore interfaces. 2016-11-02 14:43:03 -06:00
Gregory Nutt 92d3022411 Add pthread_mutexattr_get/set_protocol and non-standard sem_get/set_protocol. These may use to enable or disable priority inheritance on a single semaphore. 2016-11-02 09:05:18 -06:00
Gregory Nutt 9b5e88af71 Update some comments 2016-03-06 13:50:26 -06:00
Gregory Nutt cb9e27c3b0 Standardize naming used for public data and function groupings 2015-10-02 16:30:35 -06:00
Gregory Nutt 242b34cf46 Create a build structure that will (eventually) support using the VFS to manage named semaphores 2014-09-28 12:19:01 -06:00
Gregory Nutt e18844de32 P-code BINFMT: Add logic to pass information from the binfmt logic to the P-code interpreter. This includes some extension to the binfmt interfaces. 2014-05-08 16:58:10 -06:00
patacongo b48009644f Rename _TCB to struct tcb_s
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5610 42af7a65-404d-4744-a932-0658087f49c3
2013-02-04 18:46:28 +00:00
patacongo b4d999e963 Fix SEM_INITIALIZER
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5483 42af7a65-404d-4744-a932-0658087f49c3
2013-01-06 17:34:03 +00:00
patacongo c611d361c1 Fix some list handling associated with priority inheritance
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5053 42af7a65-404d-4744-a932-0658087f49c3
2012-08-26 21:35:14 +00:00
patacongo 98f6034444 Updated comments; starting to implement priority protection but backed everything out but some changes to comments
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4510 42af7a65-404d-4744-a932-0658087f49c3
2012-03-23 20:14:21 +00:00
patacongo 2f6adf5714 FTPD daemon and example now build without errors
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4371 42af7a65-404d-4744-a932-0658087f49c3
2012-02-05 17:36:13 +00:00
patacongo 2928511cce Add sem_timedwait()
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3798 42af7a65-404d-4744-a932-0658087f49c3
2011-07-19 13:40:15 +00:00
patacongo eeec4073a9 Switching to C99 stdint.h types
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2340 42af7a65-404d-4744-a932-0658087f49c3
2009-12-14 23:32:23 +00:00
patacongo 264806e5b2 Add test for CONFIG_SEM_PREALLOCHOLDERS > 0
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1596 42af7a65-404d-4744-a932-0658087f49c3
2009-03-13 00:25:05 +00:00
patacongo 8e93df66c6 Extend, improve, and partially fix priority inheritance logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1590 42af7a65-404d-4744-a932-0658087f49c3
2009-03-10 11:41:20 +00:00
patacongo 166b4da551 Add support for priority inheritance
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1581 42af7a65-404d-4744-a932-0658087f49c3
2009-03-08 23:33:41 +00:00
patacongo 40f92a9da4 Z16F integration changes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@595 42af7a65-404d-4744-a932-0658087f49c3
2008-01-31 17:59:22 +00:00
patacongo 3f1b80218e Restructure header files for POSIX compliance; eliminate compile warnings
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@107 42af7a65-404d-4744-a932-0658087f49c3
2007-03-20 16:51:12 +00:00
patacongo a60059d9d0 Finally, a clean SDCC compile
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@20 42af7a65-404d-4744-a932-0658087f49c3
2007-02-27 21:17:21 +00:00
patacongo b08a86171f NuttX RTOS
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3 42af7a65-404d-4744-a932-0658087f49c3
2007-02-17 23:21:28 +00:00