cancellation points are basically function. More tested is needed and additional cancellation points must be implemented before this can be merged back to master.

This commit is contained in:
Gregory Nutt
2016-12-09 12:01:18 -06:00
parent 018db84567
commit c9ca97b4b5
9 changed files with 103 additions and 3 deletions
+6
View File
@@ -48,6 +48,7 @@
#include <nuttx/clock.h>
#include <nuttx/semaphore.h>
#include <nuttx/pthread.h>
#include <nuttx/fs/fs.h>
#include <nuttx/net/net.h>
@@ -365,6 +366,10 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
int errcode;
int ret;
/* poll() is a cancellation point */
enter_cancellation_point();
/* This semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
*/
@@ -425,6 +430,7 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
}
sem_destroy(&sem);
leave_cancellation_point();
/* Check for errors */
+6
View File
@@ -110,6 +110,10 @@ int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds,
int ndx;
int ret;
/* select() is cancellation point */
enter_cancellation_point();
/* How many pollfd structures do we need to allocate? */
/* Initialize the descriptor list for poll() */
@@ -134,6 +138,7 @@ int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds,
if (!pollset)
{
set_errno(ENOMEM);
leave_cancellation_point();
return ERROR;
}
@@ -280,6 +285,7 @@ int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds,
set_errno(errcode);
}
leave_cancellation_point();
return ret;
}