Lock abstraction, introduced with a view toward making the JIT thread-safe.
[oota-llvm.git] / lib / Support / Mutex.cpp
1 //===-- Support/Lock.cpp - Platform-agnostic mutual exclusion -------------===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // Implementation of various methods supporting platform-agnostic lock
11 // abstraction. See Support/Lock.h for details.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #include "Support/Lock.h"
16
17 using namespace llvm;
18
19 Lock Lock::create () {
20   // Currently we only support creating POSIX pthread_mutex_t locks.
21   // In the future we might want to construct different kinds of locks
22   // based on what OS is running.
23   return POSIXLock ();
24 }