• Kirill Tkhai's avatar
    files: Implement {set,clear,wait}_fds_event() · 735461e1
    Kirill Tkhai authored
    The idea is symilar to kernel's wake_up() and wait_event().
    One task needs some event. It checks the event has not
    happened yet (fle hasn't received, unix peer hasn't bound, etc)
    and calls get_fds_event(). Other task makes the event
    (sends a fle, binds the peer to a name, etc) and calls set_fds_event().
    
    So, while there is no an event, the first task is sleeping,
    and the second wakes it up later:
    
    Task A:      clear_fds_event();
                 if (!socket_bound)
                         wait_fds_event(); /* sleep */
    
    Task B:      bind_socket();
                 set_fds_event();         /* wake up */
    
    For the details of using see next patches.
    
    v5: Use bit operations.
        Split clear_fds_event from wait function.
    
    v2: Do not wait for foreign transport sock is ready,
    as it's guarantied by we create it before CR_STATE_FORKING.
    
    travis-ci: success for Rework file opening scheme to make it asynchronous (rev5)
    Signed-off-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    735461e1
Name
Last commit
Last update
Documentation Loading commit data...
contrib Loading commit data...
coredump Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
include/common Loading commit data...
lib Loading commit data...
scripts Loading commit data...
soccr Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
INSTALL.md Loading commit data...
Makefile Loading commit data...
Makefile.config Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...