A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
system-thread.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2008 INRIA
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Mathieu Lacage <mathieu.lacage.inria.fr>
19
*/
20
21
#ifndef SYSTEM_THREAD_H
22
#define SYSTEM_THREAD_H
23
24
#include "ns3/core-config.h"
25
#include "
callback.h
"
26
#ifdef HAVE_PTHREAD_H
27
#include <pthread.h>
28
#endif
/* HAVE_PTHREAD_H */
29
30
namespace
ns3 {
31
47
class
SystemThread
:
public
SimpleRefCount
<SystemThread>
48
{
49
public
:
50
51
#ifdef HAVE_PTHREAD_H
52
typedef
pthread_t ThreadId;
53
#endif
54
113
SystemThread
(
Callback<void>
callback);
114
119
~SystemThread
();
120
124
void
Start
(
void
);
125
130
void
Join
(
void
);
136
static
ThreadId
Self
(
void
);
137
143
static
bool
Equals
(ThreadId
id
);
144
145
private
:
146
#ifdef HAVE_PTHREAD_H
147
static
void
*DoRun (
void
*arg);
148
149
Callback<void>
m_callback;
150
pthread_t m_thread;
151
void
* m_ret;
152
#endif
153
};
154
155
}
// namespace ns3
156
157
#endif
/* SYSTEM_THREAD_H */
158
159
src
core
model
system-thread.h
Generated on Fri Dec 21 2012 19:00:33 for ns-3 by
1.8.1.2