1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- Extended the thread-safety locking to the file descriptors.

git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14844 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-02-28 13:22:53 +00:00
parent 1df294c07e
commit c799b17bb9
25 changed files with 282 additions and 52 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_select.c,v 1.6 2005-02-27 21:58:21 obarthel Exp $
* $Id: socket_select.c,v 1.7 2005-02-28 13:22:53 obarthel Exp $
*
* :ts=4
*
@ -592,10 +592,14 @@ select(int num_fds,fd_set *read_fds,fd_set *write_fds,fd_set *except_fds,struct
* to the local copies, which take the files and sockets
* into account.
*/
__stdio_lock();
map_descriptor_sets(read_fds, num_fds, socket_read_fds, num_socket_used, &total_socket_fd, file_read_fds, num_file_used, &total_file_fd);
map_descriptor_sets(write_fds, num_fds, socket_write_fds, num_socket_used, &total_socket_fd, file_write_fds, num_file_used, &total_file_fd);
map_descriptor_sets(except_fds, num_fds, socket_except_fds, num_socket_used, &total_socket_fd, NULL, 0, &total_file_fd);
__stdio_unlock();
/* Wait for socket input? */
if(total_socket_fd > 0)
{
@ -981,9 +985,13 @@ select(int num_fds,fd_set *read_fds,fd_set *write_fds,fd_set *except_fds,struct
{
SHOWMSG("remapping fd_sets");
__stdio_lock();
remap_descriptor_sets(socket_read_fds, total_socket_fd, file_read_fds, total_file_fd, read_fds, num_fds);
remap_descriptor_sets(socket_write_fds, total_socket_fd, file_write_fds, total_file_fd, write_fds, num_fds);
remap_descriptor_sets(socket_except_fds, total_socket_fd, NULL, 0, except_fds, num_fds);
__stdio_unlock();
}
if(__check_abort_enabled)