#include "util/synchronization/semaphore.h"
#include <sys/types.h>
#include <iterator>
#include "build/build_config.h"
#include "gtest/gtest.h"
#if BUILDFLAG(IS_POSIX)
#include <pthread.h>
#endif
namespace crashpad {
namespace test {
namespace {
TEST(Semaphore, Simple) { … }
TEST(Semaphore, TimedWait) { … }
TEST(Semaphore, TimedWaitTimeout) { … }
TEST(Semaphore, TimedWaitInfinite_0) { … }
TEST(Semaphore, TimedWaitInfinite_1) { … }
struct ThreadMainInfo { … };
#if BUILDFLAG(IS_POSIX)
void*
#elif BUILDFLAG(IS_WIN)
DWORD WINAPI
#endif
ThreadMain(void* argument) { … }
void StartThread(ThreadMainInfo* info) { … }
void JoinThread(ThreadMainInfo* info) { … }
TEST(Semaphore, Threaded) { … }
TEST(Semaphore, TenThreaded) { … }
}
}
}