mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
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:
@@ -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 */
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user