FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
jack2/android/JackAndroidThread.h at develop · jackaudio/jack2 · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
jackaudio
/
jack2
Public
Notifications
You must be signed in to change notification settings
Fork
396
Star
2.4k
Code
Issues
332
Pull requests
38
Discussions
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
jack2
/
android
/
JackAndroidThread.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
97 lines (72 loc) · 3.22 KB
Breadcrumbs
jack2
/
android
/
JackAndroidThread.h
Copy path
File metadata and controls
97 lines (72 loc) · 3.22 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
Copyright (C) 2001 Paul Davis
Copyright (C) 2004-2008 Grame
Copyright (C) 2013 Samsung Electronics
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#
ifndef
__JackAndroidThread__
#
define
__JackAndroidThread__
#
include
"
JackThread.h
"
#
include
<
pthread.h
>
namespace
Jack
{
/*
use 512KB stack per thread - the default is way too high to be feasible
* with mlockall() on many systems
*/
#
define
THREAD_STACK
524288
enum
{
PTHREAD_CANCEL_DEFERRED
,
PTHREAD_CANCEL_ASYNCHRONOUS
};
/*
!
\brief The POSIX thread base class.
*/
class
SERVER_EXPORT
JackAndroidThread : public detail::JackThreadInterface
{
protected:
jack_native_thread_t
fThread
;
static
void
*
ThreadHandler
(
void
* arg);
static
void
thread_exit_handler
(
int
sig);
public:
JackAndroidThread
(JackRunnableInterface* runnable,
bool
real_time,
int
priority,
int
cancellation)
: JackThreadInterface(runnable, priority, real_time, cancellation),
fThread
((
jack_native_thread_t
)
NULL
)
{}
JackAndroidThread
(JackRunnableInterface* runnable,
int
cancellation =
PTHREAD_CANCEL_ASYNCHRONOUS
)
: JackThreadInterface(runnable,
0
,
false
, cancellation),
fThread
((
jack_native_thread_t
)
NULL
)
{}
int
Start
();
int
StartSync
();
int
Kill
();
int
Stop
();
void
Terminate
();
int
AcquireRealTime
();
//
Used when called from another thread
int
AcquireSelfRealTime
();
//
Used when called from thread itself
int
AcquireRealTime
(
int
priority);
//
Used when called from another thread
int
AcquireSelfRealTime
(
int
priority);
//
Used when called from thread itself
int
DropRealTime
();
//
Used when called from another thread
int
DropSelfRealTime
();
//
Used when called from thread itself
jack_native_thread_t
GetThreadID
();
bool
IsThread
();
static
int
AcquireRealTimeImp
(
jack_native_thread_t
thread,
int
priority);
static
int
AcquireRealTimeImp
(
jack_native_thread_t
thread,
int
priority, UInt64 period, UInt64 computation, UInt64 constraint)
{
return
JackAndroidThread::AcquireRealTimeImp
(thread, priority);
}
static
int
DropRealTimeImp
(
jack_native_thread_t
thread);
static
int
StartImp
(
jack_native_thread_t
* thread,
int
priority,
int
realtime,
void
*(*start_routine)(
void
*), void* arg);
static
int
StopImp
(
jack_native_thread_t
thread);
static
int
KillImp
(
jack_native_thread_t
thread);
};
SERVER_EXPORT
void
ThreadExit
();
}
//
end of namespace
#
endif
Back
|
FazBrowse Home
|
New Git URL