]>
git.proxmox.com Git - ceph.git/blob - ceph/src/common/Thread.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2004-2011 New Dream Network
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
20 #include <sys/types.h>
26 int ioprio_class
, ioprio_priority
;
28 const char *thread_name
;
30 void *entry_wrapper();
33 Thread(const Thread
&) = delete;
34 Thread
& operator=(const Thread
&) = delete;
40 virtual void *entry() = 0;
43 static void *_entry_func(void *arg
);
46 const pthread_t
&get_thread_id() const;
47 pid_t
get_pid() const { return pid
; }
48 bool is_started() const;
51 int try_create(size_t stacksize
);
52 void create(const char *name
, size_t stacksize
= 0);
53 int join(void **prval
= 0);
55 int set_ioprio(int cls
, int prio
);
56 int set_affinity(int cpuid
);