LLVM API Documentation

Threading.h

Go to the documentation of this file.
00001 //===-- llvm/System/Threading.h - Control multithreading mode --*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // TThis file defines llvm_start_multithreaded() and friends.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_SYSTEM_THREADING_H
00015 #define LLVM_SYSTEM_THREADING_H
00016 
00017 namespace llvm {
00018   /// llvm_start_multithreaded - Allocate and initialize structures needed to
00019   /// make LLVM safe for multithreading.  The return value indicates whether
00020   /// multithreaded initialization succeeded.  LLVM will still be operational
00021   /// on "failed" return, and will still be safe for hosting threading 
00022   /// applications in the JIT, but will not be safe for concurrent calls to the
00023   /// LLVM APIs.
00024   /// THIS MUST EXECUTE IN ISOLATION FROM ALL OTHER LLVM API CALLS.
00025   bool llvm_start_multithreaded();
00026   
00027   /// llvm_stop_multithreaded - Deallocate structures necessary to make LLVM
00028   /// safe for multithreading.
00029   /// THIS MUST EXECUTE IN ISOLATION FROM ALL OTHER LLVM API CALLS.
00030   void llvm_stop_multithreaded();
00031   
00032   /// llvm_is_multithreaded - Check whether LLVM is executing in thread-safe
00033   /// mode or not.
00034   bool llvm_is_multithreaded();
00035   
00036   /// acquire_global_lock - Acquire the global lock.  This is a no-op if called
00037   /// before llvm_start_multithreaded().
00038   void llvm_acquire_global_lock();
00039   
00040   /// release_global_lock - Release the global lock.  This is a no-op if called
00041   /// before llvm_start_multithreaded().
00042   void llvm_release_global_lock();
00043 }
00044 
00045 #endif