Cancellation points: Close up some logic to eliminte some race conditions.

This commit is contained in:
Gregory Nutt
2016-12-10 08:36:58 -06:00
parent e9d3c3362a
commit bc3ca25cc7
36 changed files with 149 additions and 68 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ int close(int fd)
/* close() is a cancellation point */
enter_cancellation_point();
(void)enter_cancellation_point();
#if CONFIG_NFILE_DESCRIPTORS > 0
/* Did we get a valid file descriptor? */
+1 -1
View File
@@ -223,7 +223,7 @@ int fcntl(int fd, int cmd, ...)
/* fcntl() is a cancellation point */
enter_cancellation_point();
(void)enter_cancellation_point();
/* Setup to access the variable argument list */
+1 -1
View File
@@ -122,7 +122,7 @@ int fsync(int fd)
/* fsync() is a cancellation point */
enter_cancellation_point();
(void)enter_cancellation_point();
/* Get the file structure corresponding to the file descriptor. */
+1 -1
View File
@@ -105,7 +105,7 @@ int open(const char *path, int oflags, ...)
/* open() is a cancellation point */
enter_cancellation_point();
(void)enter_cancellation_point();
/* If the file is opened for creation, then get the mode bits */
+1 -1
View File
@@ -368,7 +368,7 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
/* poll() is a cancellation point */
enter_cancellation_point();
(void)enter_cancellation_point();
/* This semaphore is used for signaling and, hence, should not have
* priority inheritance enabled.
+1 -1
View File
@@ -145,7 +145,7 @@ ssize_t pread(int fd, FAR void *buf, size_t nbytes, off_t offset)
/* pread() is a cancellation point */
enter_cancellation_point();
(void)enter_cancellation_point();
/* Get the file structure corresponding to the file descriptor. */
+2 -2
View File
@@ -143,7 +143,7 @@ ssize_t pwrite(int fd, FAR const void *buf, size_t nbytes, off_t offset)
/* pread() is a cancellation point */
enter_cancellation_point();
(void)enter_cancellation_point();
/* Get the file structure corresponding to the file descriptor. */
@@ -161,6 +161,6 @@ ssize_t pwrite(int fd, FAR const void *buf, size_t nbytes, off_t offset)
ret = file_pwrite(filep, buf, nbytes, offset);
}
enter_cancellation_point();
(void)enter_cancellation_point();
return ret;
}
+1 -1
View File
@@ -138,7 +138,7 @@ ssize_t read(int fd, FAR void *buf, size_t nbytes)
/* read() is a cancellation point */
enter_cancellation_point();
(void)enter_cancellation_point();
/* Did we get a valid file descriptor? */
+1 -1
View File
@@ -113,7 +113,7 @@ int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds,
/* select() is cancellation point */
enter_cancellation_point();
(void)enter_cancellation_point();
/* How many pollfd structures do we need to allocate? */
+1 -1
View File
@@ -166,7 +166,7 @@ ssize_t write(int fd, FAR const void *buf, size_t nbytes)
/* write() is a cancellation point */
enter_cancellation_point();
(void)enter_cancellation_point();
/* Did we get a valid file descriptor? */