| OLD | NEW |
| 1 // Copyright (c) 2005, Google Inc. | 1 // Copyright (c) 2005, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // Define WITH_THREADS to add pthread functionality as well (otherwise, btw, | 34 // Define WITH_THREADS to add pthread functionality as well (otherwise, btw, |
| 35 // the num_threads argument to this program is ingored). | 35 // the num_threads argument to this program is ingored). |
| 36 | 36 |
| 37 #include "config_for_unittests.h" | 37 #include "config_for_unittests.h" |
| 38 #include <stdio.h> | 38 #include <stdio.h> |
| 39 #include <stdlib.h> | 39 #include <stdlib.h> |
| 40 #ifdef HAVE_UNISTD_H | 40 #ifdef HAVE_UNISTD_H |
| 41 #include <unistd.h> // for fork() | 41 #include <unistd.h> // for fork() |
| 42 #endif | 42 #endif |
| 43 #include <sys/wait.h> // for wait() | 43 #include <sys/wait.h> // for wait() |
| 44 #include "google/profiler.h" | 44 #include "gperftools/profiler.h" |
| 45 #include "base/simple_mutex.h" | 45 #include "base/simple_mutex.h" |
| 46 #include "tests/testutil.h" | 46 #include "tests/testutil.h" |
| 47 | 47 |
| 48 static int result = 0; | 48 static int result = 0; |
| 49 static int g_iters = 0; // argv[1] | 49 static int g_iters = 0; // argv[1] |
| 50 | 50 |
| 51 Mutex mutex(Mutex::LINKER_INITIALIZED); | 51 Mutex mutex(Mutex::LINKER_INITIALIZED); |
| 52 | 52 |
| 53 static void test_other_thread() { | 53 static void test_other_thread() { |
| 54 #ifndef NO_THREADS | 54 #ifndef NO_THREADS |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 #endif | 133 #endif |
| 134 | 134 |
| 135 test_main_thread(); | 135 test_main_thread(); |
| 136 | 136 |
| 137 if (filename) { | 137 if (filename) { |
| 138 ProfilerStop(); | 138 ProfilerStop(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 return 0; | 141 return 0; |
| 142 } | 142 } |
| OLD | NEW |