Commit 66f014d0 authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Pavel Emelyanov

pstree: Add task_st bit field

(was "files: Wait transport_fd before sending a fd to peer"
and "pstree: Add task_st futex")

We are going to move to the the single per-task bit field
for notifications about file opening events. Introduce
pstree_item::task_st for that.

v5: Add FDS_EVENT_BIT description.

v2: Do not wait until a peer's socket is created
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>
parent ec1f7cab
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define __CR_PSTREE_H__ #define __CR_PSTREE_H__
#include "common/list.h" #include "common/list.h"
#include "common/lock.h"
#include "pid.h" #include "pid.h"
#include "images/core.pb-c.h" #include "images/core.pb-c.h"
...@@ -24,8 +25,14 @@ struct pstree_item { ...@@ -24,8 +25,14 @@ struct pstree_item {
struct pid *threads; /* array of threads */ struct pid *threads; /* array of threads */
CoreEntry **core; CoreEntry **core;
TaskKobjIdsEntry *ids; TaskKobjIdsEntry *ids;
futex_t task_st;
}; };
enum {
FDS_EVENT_BIT = 0,
};
#define FDS_EVENT (1 << FDS_EVENT_BIT)
struct pstree_item *current; struct pstree_item *current;
struct rst_info; struct rst_info;
......
...@@ -219,6 +219,7 @@ struct pstree_item *__alloc_pstree_item(bool rst) ...@@ -219,6 +219,7 @@ struct pstree_item *__alloc_pstree_item(bool rst)
item->pid->real = -1; item->pid->real = -1;
item->born_sid = -1; item->born_sid = -1;
item->pid->item = item; item->pid->item = item;
futex_init(&item->task_st);
return item; return item;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment