Lines Matching full:mutex
1 //===- Mutex.cpp - Mutual Exclusion Lock ------------------------*- C++ -*-===//
10 // This file implements the llvm::sys::Mutex class.
15 #include "llvm/Support/Mutex.h"
43 // Construct a Mutex using pthread calls
48 pthread_mutex_t* mutex =
52 // Initialize the mutex attributes
56 // Initialize the mutex as a recursive mutex, if requested, or normal
62 // Initialize the mutex
63 errorcode = pthread_mutex_init(mutex, &attr);
71 data_ = mutex;
74 // Destruct a Mutex
77 pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data_);
78 assert(mutex != nullptr);
79 pthread_mutex_destroy(mutex);
80 free(mutex);
86 pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data_);
87 assert(mutex != nullptr);
89 int errorcode = pthread_mutex_lock(mutex);
96 pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data_);
97 assert(mutex != nullptr);
99 int errorcode = pthread_mutex_unlock(mutex);
106 pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data_);
107 assert(mutex != nullptr);
109 int errorcode = pthread_mutex_trylock(mutex);
116 #include "Unix/Mutex.inc"
118 #include "Windows/Mutex.inc"
120 #warning Neither LLVM_ON_UNIX nor LLVM_ON_WIN32 was set in Support/Mutex.cpp