repo.or.cz
/
llvm-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git]
/
lldb
/
test
/
Shell
/
Watchpoint
/
Inputs
/
thread-dbreg.c
blob
14f3474789afded77ce8598e374ed76f680e53b4
1
#include <pthread.h>
2
3
int
g_watchme
=
0
;
4
5
void
*
thread_func
(
void
*
arg
) {
6
/* watchpoint trigger from subthread */
7
g_watchme
=
2
;
8
return
0
;
9
}
10
11
int
main
() {
12
pthread_t thread
;
13
if
(
pthread_create
(&
thread
,
0
,
thread_func
,
0
))
14
return
1
;
15
16
/* watchpoint trigger from main thread */
17
g_watchme
=
1
;
18
19
if
(
pthread_join
(
thread
,
0
))
20
return
2
;
21
22
return
0
;
23
}