projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
file creation
[lttv.git]
/
usertrace-fast
/
test.c
diff --git
a/usertrace-fast/test.c
b/usertrace-fast/test.c
index 2bd12e130adcf413e6b4c9b628301da1958d5a70..ca528fbd06795ac7433d1685a5b196ee9f162c3d 100644
(file)
--- a/
usertrace-fast/test.c
+++ b/
usertrace-fast/test.c
@@
-10,28
+10,42
@@
void *thr1(void *arg)
{
void *thr1(void *arg)
{
+ int i;
ltt_thread_init();
printf("thread 1, thread id : %lu, pid %lu\n", pthread_self(), getpid());
ltt_thread_init();
printf("thread 1, thread id : %lu, pid %lu\n", pthread_self(), getpid());
- while(1) {}
-
- return ((void*)1);
+ //while(1) {}
+ for(i=0; i<5; i++) {
+ ltt_usertrace_fast_buffer_switch();
+ sleep(1);
+ }
+ //return ((void*)1);
+ pthread_exit((void*)1);
}
void *thr2(void *arg)
{
}
void *thr2(void *arg)
{
+ int i;
ltt_thread_init();
ltt_thread_init();
- while(1) {
+
//
while(1) {
printf("thread 2, thread id : %lu, pid %lu\n", pthread_self(), getpid());
sleep(2);
printf("thread 2, thread id : %lu, pid %lu\n", pthread_self(), getpid());
sleep(2);
- }
- return ((void*)2);
+ //}
+ for(i=0; i<2; i++) {
+ ltt_usertrace_fast_buffer_switch();
+ sleep(3);
+ }
+
+
+ return ((void*)2); /* testing "die" */
+ //pthread_exit((void*)2);
}
int main()
{
}
int main()
{
+ int i;
int err;
pthread_t tid1, tid2;
void *tret;
int err;
pthread_t tid1, tid2;
void *tret;
@@
-43,10
+57,10
@@
int main()
err = pthread_create(&tid2, NULL, thr2, NULL);
if(err!=0) exit(1);
err = pthread_create(&tid2, NULL, thr2, NULL);
if(err!=0) exit(1);
- while(1)
- {
-
- }
+ for(i=0; i<2; i++) {
+ ltt_usertrace_fast_buffer_switch();
+ sleep(3);
+
}
err = pthread_join(tid1, &tret);
if(err!= 0) exit(1);
err = pthread_join(tid1, &tret);
if(err!= 0) exit(1);
This page took
0.034031 seconds
and
4
git commands to generate.