mq_timedsend(): Do check for time errors if the message queue is not full. Noted by Freddie Chopin

This commit is contained in:
Gregory Nutt
2015-03-10 09:42:35 -06:00
parent 36e88e504a
commit 4c6057eca1
6 changed files with 124 additions and 117 deletions
+3 -19
View File
@@ -12,7 +12,7 @@ nuttx/
(1) Memory Managment (mm/)
(3) Signals (sched/signal, arch/)
(2) pthreads (sched/pthread)
(1) Message Queues (sched/mqueue)
(0) Message Queues (sched/mqueue)
(4) C++ Support
(6) Binary loaders (binfmt/)
(12) Network (net/, drivers/net)
@@ -393,24 +393,8 @@ o pthreads (sched/pthreads)
solution. So I discarded a few hours of programming. Not a
big loss from the experience I gained."
Message Queues (sched/mqueue)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Title: mq_timedsend() ERROR DETECTION
Description: mq_timedsend() will always return an error an invalid time is
provided. However, OpenGroup.org says:
"Under no circumstance shall the operation fail with a timeout
if there is sufficient room in the queue to add the message
immediately. The validity of the abstime parameter need not be
checked when there is sufficient room in the queue."
Status: Open
Priority: Low. This is a valid POSIX compliance issue, but not thought
to be really important in real work programming. It could
be used to conditionally block like O_NONBLOCK by providing a
bad time to the function. That seeks hokey and I can't think
of any other real world use case the demands this functionality.
o Message Queues (sched/mqueue)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
o Kernel/Protected Build
^^^^^^^^^^^^^^^^^^^^^^
+14 -2
View File
@@ -233,7 +233,11 @@ Configurations
Configures the NuttShell (nsh) located at examples/nsh.
NOTES:
1. Default stack sizes are large and should really be tuned to reduce
1. The serial console is configured by default for use with and Arduino
serial shield (UART3). You will need to reconfigure if you will
to use a different U[S]ART.
2. Default stack sizes are large and should really be tuned to reduce
the RAM footprint:
CONFIG_ARCH_INTERRUPTSTACK=2048
@@ -242,10 +246,18 @@ Configurations
CONFIG_PTHREAD_STACK_DEFAULT=2048
... and others ...
2. NSH built-in applications are supported.
3. NSH built-in applications are supported.
Binary Formats:
CONFIG_BUILTIN=y : Enable support for built-in programs
Application Configuration:
CONFIG_NSH_BUILTIN_APPS=y : Enable starting apps from NSH command line
4. Performance-related Configuration settings:
# CONFIG_ARMV7M_ICACHE is not set : Can be enabled, not verified
# CONFIG_ARMV7M_DCACHE is not set : Can be enabled, not verified
# CONFIG_ARCH_FPU is not set : Can be enabled, not verified
# CONFIG_ARMV7M_ITCM is not set : Support not yet in place
# CONFIG_ARMV7M_DTCM is not set : Support not yet in place
+15 -14
View File
@@ -212,10 +212,10 @@ CONFIG_SAMV7_HAVE_USART2=y
# CONFIG_SAMV7_TWIM0 is not set
# CONFIG_SAMV7_TWIM1 is not set
# CONFIG_SAMV7_TWIM2 is not set
CONFIG_SAMV7_UART0=y
# CONFIG_SAMV7_UART0 is not set
# CONFIG_SAMV7_UART1 is not set
# CONFIG_SAMV7_UART2 is not set
# CONFIG_SAMV7_UART3 is not set
CONFIG_SAMV7_UART3=y
# CONFIG_SAMV7_UART4 is not set
# CONFIG_SAMV7_USBDEVHS is not set
# CONFIG_SAMV7_USBHOSTHS is not set
@@ -480,10 +480,10 @@ CONFIG_SERIAL=y
# CONFIG_DEV_LOWCONSOLE is not set
# CONFIG_16550_UART is not set
# CONFIG_ARCH_HAVE_UART is not set
CONFIG_ARCH_HAVE_UART0=y
# CONFIG_ARCH_HAVE_UART0 is not set
# CONFIG_ARCH_HAVE_UART1 is not set
# CONFIG_ARCH_HAVE_UART2 is not set
# CONFIG_ARCH_HAVE_UART3 is not set
CONFIG_ARCH_HAVE_UART3=y
# CONFIG_ARCH_HAVE_UART4 is not set
# CONFIG_ARCH_HAVE_UART5 is not set
# CONFIG_ARCH_HAVE_UART6 is not set
@@ -511,21 +511,22 @@ CONFIG_STANDARD_SERIAL=y
# CONFIG_SERIAL_OFLOWCONTROL is not set
CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
# CONFIG_SERIAL_TERMIOS is not set
CONFIG_UART0_SERIAL_CONSOLE=y
# CONFIG_UART0_SERIAL_CONSOLE is not set
CONFIG_UART3_SERIAL_CONSOLE=y
# CONFIG_OTHER_SERIAL_CONSOLE is not set
# CONFIG_NO_SERIAL_CONSOLE is not set
#
# UART0 Configuration
# UART3 Configuration
#
CONFIG_UART0_RXBUFSIZE=256
CONFIG_UART0_TXBUFSIZE=256
CONFIG_UART0_BAUD=115200
CONFIG_UART0_BITS=8
CONFIG_UART0_PARITY=0
CONFIG_UART0_2STOP=0
# CONFIG_UART0_IFLOWCONTROL is not set
# CONFIG_UART0_OFLOWCONTROL is not set
CONFIG_UART3_RXBUFSIZE=256
CONFIG_UART3_TXBUFSIZE=256
CONFIG_UART3_BAUD=115200
CONFIG_UART3_BITS=8
CONFIG_UART3_PARITY=0
CONFIG_UART3_2STOP=0
# CONFIG_UART3_IFLOWCONTROL is not set
# CONFIG_UART3_OFLOWCONTROL is not set
# CONFIG_USBDEV is not set
# CONFIG_USBHOST is not set
# CONFIG_WIRELESS is not set
-1
View File
@@ -180,4 +180,3 @@ int mq_send(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio)
sched_unlock();
return ret;
}
+1 -1
View File
@@ -306,7 +306,7 @@ int mq_waitsend(mqd_t mqdes)
*
* Description:
* This is internal, common logic shared by both mq_send and mq_timesend.
* This function adds the specificied message (msg) to the message queue
* This function adds the specified message (msg) to the message queue
* (mqdes). Then it notifies any tasks that were waiting for message
* queue notifications setup by mq_notify. And, finally, it awakens any
* tasks that were waiting for the message not empty event.
File diff suppressed because it is too large Load Diff