FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
mercury/java/runtime/MercuryThread.java at master · Mercury-Language/mercury · GitHub
Mercury-Language
/
mercury
Public
Notifications
You must be signed in to change notification settings
Fork
71
Star
1.1k
Code
Issues
13
Pull requests
8
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
mercury
/
java
/
runtime
/
MercuryThread.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
52 lines (44 loc) · 1.17 KB
Breadcrumbs
mercury
/
java
/
runtime
/
MercuryThread.java
Copy path
File metadata and controls
52 lines (44 loc) · 1.17 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
// vim: ts=4 sw=4 expandtab ft=java
//
// Copyright (C) 2014, 2018 The Mercury Team
// This file is distributed under the terms specified in COPYING.LIB.
//
package
jmercury
.
runtime
;
/**
* A thread with some Mercury specific support.
*/
public
abstract
class
MercuryThread
extends
Thread
{
private
int
id
;
/**
* Construct a new MercuryThread with the given ID.
* @param name A string that identifies the type of thread.
* @param id A numeric identifier (should be unique).
*/
public
MercuryThread
(
String
name
,
int
id
)
{
super
(
name
+
" "
+
id
);
this
.
id
=
id
;
}
/**
* The thread has become blocked.
*/
public
abstract
void
blocked
();
/**
* The thread is unblocked and is now running again.
*/
public
abstract
void
running
();
/**
* If the current thread is a MercuryThread then return a reference to it.
*/
public
static
MercuryThread
currentThread
()
{
Thread
thread
;
thread
=
Thread
.
currentThread
();
if
(
thread
instanceof
MercuryThread
) {
return
(
MercuryThread
)
thread
;
}
else
{
return
null
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL