-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy paththreads-classes.puml
67 lines (51 loc) · 1.21 KB
/
threads-classes.puml
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
@startuml
namespace pthread {
enum thread_status{
not_a_thread
a_thread
}
interface runnable {
+void run ()
}
abstract abstract_thread {
+void start()
+void join()
+bool joinable() const
+{abstract} void run()
}
abstract_thread ..|> runnable : implements
note top of abstract_thread : this is the base class \nof all your threads.
class thread{
+thread(runnable)
+void start()
+void join()
+bool joinable() const
+thread_status status()
...
-- operators --
+thread& operator=(thread&& other)
}
thread ... thread_status : uses
thread .. runnable : uses
class thread_group {
+void add(abstract_thread *thread);
+void start();
+void join();
+const bool destructor_joins_first()
}
thread_group "1"--o "*" abstract_thread : _threads
class consumer <<sample>>{
+void run()
}
consumer --|> abstract_thread : extends
class producer <<sample>> {
+void run()
}
producer --|> abstract_thread : extends
note as SAMPLES
These are sample classes.
end note
SAMPLES .. consumer
SAMPLES .. producer
}
@enduml