criu/include/common
Kirill Tkhai 735461e1bf files: Implement {set,clear,wait}_fds_event()
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: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-06 14:09:13 +03:00
..
arch bits: Add test_and_set_bit() 2017-02-06 14:09:13 +03:00
asm-generic headers: Fix iquote for include/common 2016-11-03 00:13:04 +03:00
bitops.h common: Use complete path in inclusion 2016-11-03 00:13:04 +03:00
bitsperlong.h common: bitsperlong -- Specify complete path 2016-11-03 00:13:04 +03:00
bug.h include/common: Move bug.h in 2016-11-03 00:13:03 +03:00
compiler.h common: Move compiler.h into 2016-11-03 00:13:03 +03:00
err.h headers: Move err.h to common 2016-11-03 00:13:04 +03:00
list.h common: Move compiler.h into 2016-11-03 00:13:03 +03:00
lock.h files: Implement {set,clear,wait}_fds_event() 2017-02-06 14:09:13 +03:00
page.h common: Use complete path in inclusion 2016-11-03 00:13:04 +03:00
scm-code.c util: zero msghdr structures 2017-02-06 13:29:55 +03:00
scm.h scm: Allow to pass flags argument to recv_fds() 2017-02-03 18:04:22 +03:00
xmalloc.h headers: Move xmalloc to common 2016-11-03 00:13:04 +03:00