From cd306431b9f83c955e9fb68bea5cbb7d88e631ae Mon Sep 17 00:00:00 2001 From: sletz Date: Sat, 16 Sep 2006 17:46:02 +0000 Subject: [PATCH] Cleanup git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1240 0c269be4-1314-0410-8aa9-9f06e86f4224 --- tests/testSem.cpp | 6 ++---- tests/testThread.cpp | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/tests/testSem.cpp b/tests/testSem.cpp index 7bebd282..3cc7c7f0 100644 --- a/tests/testSem.cpp +++ b/tests/testSem.cpp @@ -61,8 +61,7 @@ struct ServerThread : public JackRunnableInterface { bool Execute() { printf("Execute Server\n"); - for (int i = 0; i < ITER; i++) - { + for (int i = 0; i < ITER; i++) { fClientSem->Signal(); fServerSem->Wait(); } @@ -100,8 +99,7 @@ struct ClientThread : public JackRunnableInterface { fClientSem->Wait(); gettimeofday(&T0, 0); - for (int i = 0; i < ITER; i++) - { + for (int i = 0; i < ITER; i++) { fServerSem->Signal(); fClientSem->Wait(); } diff --git a/tests/testThread.cpp b/tests/testThread.cpp index 7c817f1a..de012f77 100644 --- a/tests/testThread.cpp +++ b/tests/testThread.cpp @@ -38,29 +38,29 @@ void* ThreadHandler(void* arg) char c; printf("ThreadHandler\n"); try { - while (1) { - read(fFifo, &c, sizeof(c)); - sleep (1); - //pthread_testcancel(); - } - }catch (std::exception e) {} + while (1) { + read(fFifo, &c, sizeof(c)); + sleep(1); + //pthread_testcancel(); + } + } catch (std::exception e) {} } -int main (int argc, char * const argv[]) +int main(int argc, char * const argv[]) { int res; void* status; struct stat statbuf; printf("Thread test\n"); - std::set_terminate (__gnu_cxx::__verbose_terminate_handler); + std::set_terminate(__gnu_cxx::__verbose_terminate_handler); sprintf(fName, "/tmp/fifo"); if (stat(fName, &statbuf)) { if (errno == ENOENT) { - if (mkfifo(fName, 0666) < 0){ + if (mkfifo(fName, 0666) < 0) { printf("Cannot create inter-client FIFO [%s]\n", fName); return 0; } @@ -85,7 +85,7 @@ int main (int argc, char * const argv[]) return 0; } - sleep (3); + sleep(3); printf("Cancel Thread\n"); pthread_cancel(fThread); pthread_join(fThread, &status);