cisst-saw
Toggle main menu visibility
Loading...
Searching...
No Matches
tmp
cisst-saw
cisst
cisstOSAbstraction
osaThreadBuddy.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4
/*
5
6
Author(s): Ankur Kapoor, Min Yang Jung
7
Created on: 2004-04-30
8
9
(C) Copyright 2004-2010 Johns Hopkins University (JHU), All Rights
10
Reserved.
11
12
--- begin cisst license - do not edit ---
13
14
This software is provided "as is" under an open source license, with
15
no warranty. The complete license can be found in license.txt and
16
http://www.cisst.org/cisst/license.txt.
17
18
--- end cisst license ---
19
*/
20
21
26
27
#ifndef _osaThreadBuddy_h
28
#define _osaThreadBuddy_h
29
30
#include <
cisstCommon/cmnPortability.h
>
31
#include <
cisstOSAbstraction/osaTimeServer.h
>
32
#include <
cisstOSAbstraction/osaThread.h
>
33
34
// Always include last
35
#include <
cisstOSAbstraction/osaExport.h
>
36
41
CISST_EXPORT
void
__os_init
(
void
);
42
46
CISST_EXPORT
void
__os_exit
(
void
);
47
48
49
struct
osaThreadBuddyInternals;
50
63
class
CISST_EXPORT
osaThreadBuddy
{
64
65
osaThreadBuddyInternals* Data;
66
68
double
Period;
69
70
public
:
72
osaThreadBuddy
();
73
75
~osaThreadBuddy
();
76
86
void
Create
(
const
char
*name,
double
period,
int
stack_size = 1024*256);
87
void
Create
(
const
char
*name,
const
osaAbsoluteTime
& tv,
int
stack_size = 1024*256 );
88
90
void
Delete
();
91
94
bool
IsPeriodic
()
const
{
return
Period > 0; }
95
98
void
WaitForPeriod
(
void
);
99
102
void
WaitForRemainingPeriod
(
void
);
103
105
void
MakeHardRealTime
(
void
);
106
108
void
MakeSoftRealTime
(
void
);
109
111
void
Resume
(
void
);
112
114
void
Suspend
(
void
);
115
117
void
LockStack
();
118
120
void
UnlockStack
();
121
};
122
123
124
#endif
// _osaThreadBuddy_h
125
osaThreadBuddy::Suspend
void Suspend(void)
osaThreadBuddy::Create
void Create(const char *name, double period, int stack_size=1024 *256)
osaThreadBuddy::LockStack
void LockStack()
osaThreadBuddy::osaThreadBuddy
osaThreadBuddy()
osaThreadBuddy::Resume
void Resume(void)
osaThreadBuddy::WaitForPeriod
void WaitForPeriod(void)
osaThreadBuddy::Create
void Create(const char *name, const osaAbsoluteTime &tv, int stack_size=1024 *256)
osaThreadBuddy::WaitForRemainingPeriod
void WaitForRemainingPeriod(void)
osaThreadBuddy::~osaThreadBuddy
~osaThreadBuddy()
osaThreadBuddy::IsPeriodic
bool IsPeriodic() const
Definition
osaThreadBuddy.h:94
osaThreadBuddy::MakeHardRealTime
void MakeHardRealTime(void)
osaThreadBuddy::MakeSoftRealTime
void MakeSoftRealTime(void)
osaThreadBuddy::UnlockStack
void UnlockStack()
osaThreadBuddy::Delete
void Delete()
CISST_EXPORT
#define CISST_EXPORT
Definition
cmnExportMacros.h:50
cmnPortability.h
Portability across compilers and operating systems tools.
__os_exit
CISST_EXPORT void __os_exit(void)
__os_init
CISST_EXPORT void __os_init(void)
osaExport.h
Macros to export the symbols of cisstOSAbstraction (in a Dll).
osaThread.h
Declaration of osaThread.
osaTimeServer.h
Declaration of osaTimeServer class.
osaAbsoluteTime
Definition
osaTimeServer.h:36
Generated by
1.18.0