projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup: rotation-thread: enforce conding standard following fix
[lttng-tools.git]
/
src
/
common
/
pipe.hpp
diff --git
a/src/common/pipe.hpp
b/src/common/pipe.hpp
index d46e65d6833a32b97228e7a76573aaca829e2b64..4e6afc567831868c570ab36c2fa8998fd8357ca0 100644
(file)
--- a/
src/common/pipe.hpp
+++ b/
src/common/pipe.hpp
@@
-8,8
+8,10
@@
#ifndef LTTNG_PIPE_H
#define LTTNG_PIPE_H
#ifndef LTTNG_PIPE_H
#define LTTNG_PIPE_H
-#include <pthread.h>
#include <common/macros.hpp>
#include <common/macros.hpp>
+#include <common/make-unique-wrapper.hpp>
+
+#include <pthread.h>
#include <sys/types.h>
enum lttng_pipe_state {
#include <sys/types.h>
enum lttng_pipe_state {
@@
-17,7
+19,19
@@
enum lttng_pipe_state {
LTTNG_PIPE_STATE_CLOSED = 2,
};
LTTNG_PIPE_STATE_CLOSED = 2,
};
+/* Close both side of pipe. */
+int lttng_pipe_close(struct lttng_pipe *pipe);
+
struct lttng_pipe {
struct lttng_pipe {
+ static void _lttng_pipe_close_wrapper(lttng_pipe *pipe)
+ {
+ lttng_pipe_close(pipe);
+ }
+
+ using uptr = std::unique_ptr<
+ lttng_pipe,
+ lttng::details::create_unique_class<lttng_pipe, _lttng_pipe_close_wrapper>::deleter>;
+
/* Read: 0, Write: 1. */
int fd[2];
/*
/* Read: 0, Write: 1. */
int fd[2];
/*
@@
-69,8
+83,6
@@
struct lttng_pipe *lttng_pipe_named_open(const char *path, mode_t mode,
int flags);
int lttng_pipe_write_close(struct lttng_pipe *pipe);
int lttng_pipe_read_close(struct lttng_pipe *pipe);
int flags);
int lttng_pipe_write_close(struct lttng_pipe *pipe);
int lttng_pipe_read_close(struct lttng_pipe *pipe);
-/* Close both side of pipe. */
-int lttng_pipe_close(struct lttng_pipe *pipe);
void lttng_pipe_destroy(struct lttng_pipe *pipe);
ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count);
void lttng_pipe_destroy(struct lttng_pipe *pipe);
ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count);
This page took
0.023664 seconds
and
4
git commands to generate.